C++第一章
i_3ummer
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
1-7
#includeusing 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 · 188 阅读 · 0 评论 -
1-8
#includeusing 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 · 189 阅读 · 0 评论 -
1-9
#includeusing 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 · 228 阅读 · 0 评论 -
1-10
#include#includeusing namespace std;int main(){ string str1,str2; cin>>str1>>str2; str1=str1+str2; cout return 0; }原创 2015-04-07 13:01:59 · 193 阅读 · 0 评论 -
1-13
#includeusing 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 · 218 阅读 · 0 评论 -
1-12
#include#includeusing 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 · 168 阅读 · 0 评论 -
1-14
#includeusing namespace std;templateT 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 · 232 阅读 · 0 评论 -
1-11
#include#includeusing 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 · 207 阅读 · 0 评论
分享