欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: c++ 3個字符串,找出其中的最大者 [打印本頁]

作者: daming    時間: 2014-12-30 15:51
標題: c++ 3個字符串,找出其中的最大者
  1. #include<iostream>
  2. #include<string.h>
  3. using namespace std;
  4. void main()
  5. {
  6. char string[20];
  7. char str[3][20];
  8. int i;
  9. cout<<"請輸入個字符串"<<endl;
  10. for(i=0;i<3;i++)
  11.   gets(str[i]);
  12. if(strcmp(str[0],str[1])>0)
  13.   strcpy(string,str[0]);
  14. else strcpy(string,str[1]);
  15. if(strcmp(str[2],string)>0)
  16.   strcpy(string,str[2]);
  17. cout<<"最大的那個字符串是:"<<string<<endl;
  18. }
復制代碼







歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1