C++第一章
i_3ummer
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
1-7
#include using namespace std; int max(int x,int y,int z=3) { if(x>y) y=x; if(y>z) z=y; return z; } int main() { int a,b,c; cin>>a>>b>>c; c=max(a,b,c); cout return 0; }原创 2015-03-30 23:22:40 · 201 阅读 · 0 评论 -
1-8
#include using namespace std; int sort(int &x,int &y) { int temp; if(y>x) { temp=x; x=y; y=temp; } return 0; } int main() { int a,b; cin>>a>>b; sort(a,b); cout r原创 2015-04-07 12:51:35 · 197 阅读 · 0 评论 -
1-9
#include using namespace std; void swap(int &x,int &y,int &z) { int temb; if(y { temb=x; x=y; y=temb; } if(z { temb=z; z=y; y=temb; }原创 2015-04-07 12:56:12 · 250 阅读 · 0 评论 -
1-10
#include #include using namespace std; int main() { string str1,str2; cin>>str1>>str2; str1=str1+str2; cout return 0; }原创 2015-04-07 13:01:59 · 208 阅读 · 0 评论 -
1-13
#include using namespace std; int sort(int a[],int n) { int i,j,temb; for(i=0;i { for(j=0;j { if(a[i] { temb=a[i]; a[i]=a[i-1]; a[i-1]=temb;原创 2015-04-07 18:10:56 · 233 阅读 · 0 评论 -
1-12
#include #include using namespace std; void bubble_sort(string a[],int n) { int i,j; string temb; for(i=0;i { for(j=0;j { if(a[j]>=a[j-1]) { temb=a[j]; a[j]=a[j-1];原创 2015-04-07 18:09:49 · 182 阅读 · 0 评论 -
1-14
#include using namespace std; template T sort(T a[],T n,T temb) { int i,j; for(i=0;i { for(j=0;j { if(a[i] { temb=a[i]; a[i]=a[i-1]; a[i-1]=tem原创 2015-04-07 18:12:57 · 245 阅读 · 0 评论 -
1-11
#include #include using namespace std; int main() { string str; cin>>str; int i,j; int length=sizeof(str); for(i=length-1;i>=0;i--) { cout } return 0; }原创 2015-04-07 13:02:58 · 227 阅读 · 0 评论
分享