您的位置:首页 > 其它

第二场热身赛A(简单水题)

2012-10-06 16:52 169 查看
其实就是让你求出来,所输入的字符串中的大写字母,然后输出,,

自己的代码就不看了,丑死了,看标称:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <ctype.h>
#include <string>

using namespace std;

int main()
{
string str;
cin>>str;
for(int i=0;i<(str.size());i++)
{
if(isupper(str[i]))
cout<<str[i];
}
cout<<endl;
return 0;
}


好漂亮的代码,string是很好用的.

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  string