杭电OJ2026

#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
	char s[200];
	while (gets(s)!=NULL)
	{
		int i;
		int x = strlen(s);
		s[0] = s[0] - 32;
		for (i = 1; i < x; i++)
		{
			if (s[i] == ' ')
				s[i + 1] = s[i + 1] - 32;
		}
		for (i = 0; i < x; i++)
			cout << s[i];
		cout << endl;
	}
}

猜你喜欢

转载自blog.csdn.net/weixin_42265486/article/details/83984364