样例第四个改错了
查看原帖
样例第四个改错了
1356594
zhenghaoHoney楼主2024/8/22 09:25
#include<iostream>
#include<cstring> 
using namespace std;

int n;
char s[110]; 
int main(){
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>s;
		int len=strlen(s);
		if(s[0]>='a'&&s[0]<='z')
		{
			s[0]=char(s[0]-32);
		}
		for(int j=0;j<len;j++)
		{
			if(s[j]>='A'&&s[j]<='Z')
			{
				s[j]=char(s[j]+32);
			}
			
		} 
		cout<<s<<endl;
	}
	return 0;
}
2024/8/22 09:25
加载中...