The 7th Zhejiang Provincial Collegiate Programming Contest->Problem B:B - Somali Pirates

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3323

题意:去掉字符串里面的数字然后按输入顺序输出

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 
 4 int main(){
 5     int t;
 6     cin>>t;
 7     while(t--){
 8         string aa;
 9         cin>>aa;
10         for(int i=0;i<aa.length();i++){
11             if(aa[i]<'0'||aa[i]>'9')
12             printf("%c",aa[i]);
13         }
14         cout<<endl;
15     }
16     return 0;
17 } 

 

posted @ 2016-02-26 22:33  April_AA  阅读(130)  评论(0编辑  收藏  举报