3.14

来源:互联网 发布:mac preview 合并pdf 编辑:程序博客网 时间:2024/05/07 13:34
# include<iostream>
# include<vector>
# include<string>
# include<cctype>
using namespace std;
int main()

 vector<string> svec;
 string str;
 cout<<"Enter strings (Crtl+Z to end):"<<endl;
 while (cin>>str)
  svec.push_back(str);
 if (svec.size()==0)
 {
  cout<<"No string?!"<<endl;
  system("pause");
  return -1;
 }
 cout<<"Transformed strings from the vector:"<<endl;
 for (vector<string>::size_type ix=0;ix!=svec.size();++ix)
 {
  for(vector<string>::size_type index=0;index!=svec[ix].size();++index)
   if (islower(svec[ix][index]))
    svec[ix][index]=toupper(svec[ix][index]);
  cout<<svec[ix]<<" ";
  if((ix+1)%8==0)
   cout<<endl;
 }
 system("pause");
 return 0;
}
 
原创粉丝点击