码迷,mamicode.com
首页 > 其他好文 > 详细

exercises 3.6

时间:2015-04-16 12:19:40      阅读:91      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!