要求实现:输入: this is a dig.
输出:This Is A Dog.
即把字符串中单词首字母变为大写,若已经是大写或者其他字符,则不变,单词间用空格隔开。
#include <stdio.h>
int main()
{
char *p[50],**t;
int n;
t=p;
do
{
scanf("%s",*t);
t++;
}while(getchar()!='\n');
n=t-p;
for(t=p;t<p+n;t++)
{
if(((**t)>='a')&&((**t)<='z'))
(**t)=(**t)-32;
printf("%s ",*t);
}
putchar(10);
return 0;
}