#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <ctype.h>
#include <string.h>
void Daxie(char str1[])
{
int i = 0;
int start = 1;
while (str1[i] != '\n')
{
if (start && !isspace(str1[i]))
{
str1[i] = toupper(str1[i]);//将字符串元素大写
start = 0;
}
if (isspace(str1[i]))
{
start = 1;
}
i++;
}
}
int main()
{
char str1[1000];
printf("请输入一行字符\n");
if(fgets(str1, sizeof(str1), stdin) != NULL);
{
Daxie(str1);
printf("%s\n", str1);
}
return 0;
}