UDP广播协议叫吃饭


私信TA

用户名:Mustenaka

访问量:138711

签 名:

个人博客www.mustenaka.cn

等  级
排  名 13
经  验 24144
参赛次数 8
文章发表 197
年  龄 3
在职情况 学生
学  校 Sky_box
专  业 NE

  自我简介:

欢迎光临我的博客www.mustenaka.cn,Python,C#,U3D,C/C++开发合作可以找我

解题思路:
        其实C++在之初更加推荐对自己的新特新使用迭代器的便利方式,所谓迭代器就是属于C++自身新模版的一种容器,旧时的容器使用iterator,新的容易定义方法用auto,据说C20要来了,C20要又要修改迭代器使用方法,使之变得跟C使用数组下标一样方便。
参考代码:

#include<bits/stdc++.h>
using namespace std;
int main(){
	string ssh;
	while(getline(cin,ssh)){
		for(string::iterator it=ssh.begin();it!=ssh.end();it++){
			if(*it>='a'&&*it<='z'){
				*it-=('a'-'A');
			}
		}
		cout<<ssh<<endl;
	}
}


 

0.0分

2 人评分

  评论区