C 50分,大神求助!
查看原帖
C 50分,大神求助!
833293
liaojing楼主2022/11/30 11:26
#include<stdio.h>
#include<string.h>

#define max 1000002
char s[max];
int main()
{
	int f = 0;
	gets(s);
	int lens = strlen(s);
	for (int i = 0; i <= lens; ++i)
	{
		if (s[i] == ' ') {
			f = 0;
		}
		else {
			f++;
		}
		if (f % 2 != 0) {
			s[i] -= 32;
		}
	}
	for (int i =0; i < lens; ++i) 
	{
		printf("%c", s[i]);
	}
	return 0;
}
2022/11/30 11:26
加载中...