周赛问题 福州 B - Somali Pirates
2013-11-18 22:16
323 查看
DescriptionIt is said that the famous Somali Pirates hate digits. So their QQ passwords never contain any digit. Given some lines of candidate passwords, you are asked to delete all the digits in the passwords and print other characters in their original order. Sothe Somali Pirates can use them as their QQ passwords^^InputThere are multiple test cases. The first line of input is an integer T (T <= 10) indicating the number of test cases.Each case contains a line indicating a candidate password. The length of the password is between 1 and 20, inclusive. Besides, the password consists of only digits and English letters.OutputFor each candidate password, delete all the digits and print the remaining characters in a line.Sample Input
2 BeatLA123 1plus1equals1Sample Output
BeatLA plusequals
#include <iostream>#include <cstring>using namespace std;int main(){int t;while(cin>>t){while(t--){string a;cin>>a;//int l=strlen(a);int l=a.size();for(int i=0; i<l; i++){if(a[i]>='0'&&a[i]<='9'){a[i]=' ';}}for(int i=0; i<l; i++){if(a[i]==' ')continue;elsecout<<a[i];}cout<<endl;}}return 0;}[/code]
相关文章推荐
- 周赛问题 福州 B - 单词问题
- 周赛问题 福州 竞技游戏
- 周赛问题 福州 升降序列
- 周赛问题 福州 A - Who is Older?
- 周赛问题 福州 L - Guess the Price
- 周赛问题 福州 龟兔赛跑
- 周赛问题 福州 A - 代码问题
- 周赛题目 福州 神庙逃亡
- 周赛题目 福州 数字的孔数
- 周赛题目 福州 最长队名
- 周赛题目 福州 数字游戏
- 周赛题目 福州 password table
- 2015 年 JXNU_ACS 算法组寒假第一次周赛 1007 汉诺塔问题
- CSDNBLOG的技术问题
- Unknown():Unable to load dynamic library 问题解决
- 解决Windows 2000无法访问Windows XP共享目录的问题
- ORACEL中使用IMP出现的表空间不一致的问题暂时解决办法
- 如何在 Windows 恢复环境中使用 Bootrec.exe 工具解决和修复 Windows Vista 中的启动问题
- cs0016问题
- [C#]关于DLL使用.exe.config 的问题,也许以下描述有一点帮助