第一章
来源:互联网 发布:淘宝网页卖家中心 编辑:程序博客网 时间:2024/06/10 11:59
//NUM 7#include <iostream>using namespace std;int main(){int a=5,b=7,c=1,t;if(a>b)t=a;else t=b;if(c>t)t=c;else t=t;cout<<"max = "<<t<<endl;return 0;}
//NUM 8
#include <iostream>using namespace std;int main(){void change (int &x,int &y);int a,b;cin>>a>>b;if(a<b){change(a,b);}cout<<a<<" "<<b<<endl;return 0;}void change (int &x,int &y){int t;t=y;y=x;x=t;}
//NUM 9#include <iostream>using namespace std;int main(){void change (int &x,int &y);int a,b,c;cin>>a>>b>>c;if(a>b)change(a,b);if(a>c)change(a,c);if(b>c)change(b,c);cout<<a<<" "<<b<<" "<<c<<endl;return 0;}void change (int &x,int &y){int t;t=y;y=x;x=t;}
//NUM 10#include <iostream>using namespace std;#include <string>int main (){string S;cin>>S;string A;cin>>A;S=S+A;cout<<S<<endl;return 0;}
//NUM 11#include <iostream>#include <string>using namespace std;int main(){string s;int i,n;char t;cin>>s;n=s.size();for(i=0;i<n/2;i++){t=s[i];s[i]=s[n-i-1];s[n-i-1]=t;}cout<<s<<endl;return 0;}
//NUM 12#include <iostream>#include <string>using namespace std;int main(){ int i;string str[5]={"china","USA","war","leagle","ACE"};void sort(string []);sort(str);cout<<""<<endl;for(i=0;i<5;i++)cout<<str[i]<<" "; cout<<endl;return 0;}void sort(string s[]){int i,j;string t;for (j=0;j<5;j++)for(i=0;i<5-j;i++)if (s[i]>s[i+1]){t=s[i];s[i]=s[i+1];s[i+1]=t;} }
0 0
- 第一章>
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- 第一章
- Markdown 常见语法记录
- [翻译]Drools6.2帮助文档-11.与Spring集成
- Editor图片预览
- Python操作MySQL数据库实例
- zoj 2852 Deck of Cards扑克牌(三维dp)
- 第一章
- Spring Mvc与struts2区别
- HTTP协议详解
- 微信公众号
- sizeof(数组名)和sizeof(指针)
- java程序性能优化
- Configuring the ECC of Nvidia GPUs under Linux
- 对三个变量按由小到大顺序排序,要求使用变量的引用
- 小览call stack(调用栈) (一)