首页 > 其他 > 详细

exercises 3.6

时间:2015-04-16 12:17:06      阅读:182      评论:0      收藏:0      [点我收藏+]
 1 #include <iostream>
 2 #include <string>
 3 using namespace std;
 4 
 5 
 6 int main()
 7 {
 8     string str("some thing");
 9     for(auto &c:str)
10         if(!isspace(c))
11             c=X;
12     
13     cout<<str<<endl;
14     return 0;
15 }

 

 1 #include <iostream>
 2 #include <string>
 3 using namespace std;
 4 
 5 
 6 int main()
 7 {
 8     string str("some thing");
 9     for(decltype(str.size()) i = 0 ; i<str.size() ; ++i)
10         if(!isspace(str[i]))str[i]=X;
11     
12     cout<<str<<endl;
13     return 0;
14 }

 

exercises 3.6

原文:http://www.cnblogs.com/austuode/p/4431496.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!