?? 2026.c
字號:
/*
Problem Description
輸入一個英文句子,將每個單詞的第一個字母改成大寫字母。
Input
輸入數(shù)據(jù)包含多個測試實例,每個測試實例是一個長度不超過100的英文句子,占一行。
Output
請輸出按照要求改寫后的英文句子。
Sample Input
i like acm
i want to get an accepted
Sample Output
I Like Acm
I Want To Get An Accepted
*/
#include <stdio.h>
//#include <stdlib.h>
#include <ctype.h>
#define low2up(ch) (islower(ch)?((ch)-32):(ch))
int main(void)
{
char str[100];
int i;
while(gets(str)&&strlen(str))
{
str[0]=low2up(str[0]);
for(i=0;str[i];i++)
{
if(isspace(str[i]))
{
i++;
str[i]=low2up(str[i]);
}
}
puts(str);
}
// system("PAUSE");
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -