输出没空格
#include <stdio.h>#include <stdlib.h>
#include "string.h"
#include "ctype.h"
int main()
{int i,n,k;
char a[50];
while(scanf("%d",&n)!=EOF)
{
for(i=1;i<=n;i++)
{
scanf("%s",a);
getchar();
k=strlen(a);
if (islower(a[0])) printf("%c",toupper(a[0]));
for (i=1;i<=k-1;i++)
{
if (a[i-1]==' ' || a[i-1]==',')
{a[i]=a[i]-32;
printf(" ");}
printf("%c",a[i]);
}}
}
return 0;
}
2
i like acm
i want to get an accepted
范例输出:
I Like Acm
I Want To Get An Accepted
改写首字母大写 为什么中间输不出空格