现在的位置: 首页 > 综合 > 正文

hdu1161Eddy’s mistakes把字符串中的大写字母换成小写输出

2019年11月07日 ⁄ 综合 ⁄ 共 183字 ⁄ 字号 评论关闭

把字符串中的大写字母换成小写输出

这样写:

#include<iostream>
#include<cctype>
#include<cstring>
using namespace std;
int main()
{
	char s[1010];
	while(gets(s))
	{
		int i=-1;
		while(s[++i])
			putchar(tolower(s[i]));
		cout<<endl;
	}
}

抱歉!评论已关闭.