C++ primer P81 练习3.5

来源:互联网 发布:sql语句修改表结构 编辑:程序博客网 时间:2024/06/07 03:02
#include <iostream>#include <string>using namespace std;int main(){   string s,s1,s2;   int i = 0;   string str[100];   while (cin >> s){      str[i] = s;      cout << s << endl;      i++;    }   int j;   for (j = 0; j <= i;j++){      s1 = s1 + str[j];      s2 = s2 + str[j]+" ";   }   cout << s1 << endl<<s2<<endl;   return 0;}


0 0