2个回答
2013-06-30
展开全部
#include <stdio.h>
#include <conio.h>
main()
{
char str[100] = {0};
printf( "input:\n" );
scanf( "%s",str );
int i = 0;
if( str[0]>='a' && str[0]<='z' ) str[0]=str[0]-'a'+'A';
while( str[i] != '\0' )
{
if( str[i] == ' ' )
{
if( str[i+1]>='a' && str[i+1]<='z' )
{
str[i+1]=str[i+1]-'a'+'A';
i++;
}
}
}
}
#include <conio.h>
main()
{
char str[100] = {0};
printf( "input:\n" );
scanf( "%s",str );
int i = 0;
if( str[0]>='a' && str[0]<='z' ) str[0]=str[0]-'a'+'A';
while( str[i] != '\0' )
{
if( str[i] == ' ' )
{
if( str[i+1]>='a' && str[i+1]<='z' )
{
str[i+1]=str[i+1]-'a'+'A';
i++;
}
}
}
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-06-30
展开全部
忘了输出,补上
#include <stdio.h>
#include <conio.h>
main()
{
char str[100] = {0};
printf( "input:\n" );
scanf( "%s",str );
int i = 0;
if( str[0]>='a' && str[0]<='z' ) str[0]=str[0]-'a'+'A';
while( str[i] != '\0' )
{
if( str[i] == ' ' )
{
if( str[i+1]>='a' && str[i+1]<='z' )
{
str[i+1]=str[i+1]-'a'+'A';
i++;
}
}
}
printf( "\n%s\n",str );
getch();
}
#include <stdio.h>
#include <conio.h>
main()
{
char str[100] = {0};
printf( "input:\n" );
scanf( "%s",str );
int i = 0;
if( str[0]>='a' && str[0]<='z' ) str[0]=str[0]-'a'+'A';
while( str[i] != '\0' )
{
if( str[i] == ' ' )
{
if( str[i+1]>='a' && str[i+1]<='z' )
{
str[i+1]=str[i+1]-'a'+'A';
i++;
}
}
}
printf( "\n%s\n",str );
getch();
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询