c求助大佬
查看原帖
c求助大佬
1047741
Warren1321楼主2023/8/12 23:48

为啥只有第一个字母大写了?

#include <stdio.h>
#include <string.h>

int main (void)
{
	int i=0;
	char s[101] = "";
	scanf ("%s", s);
	int len = strlen(s);
	for (int i =0; i<len; i++);
	{
		if (s[i]>='a' && s[i]<='z');
		{
			s[i] = s[i] - 32;
		}
	}
	printf("%s",s);
	return 0;
}
2023/8/12 23:48
加载中...