HDOJ2026 ( 首字母变大写 )【水题】

it2022-05-17  74

Problem : 2026 ( 首字母变大写 )     Judge Status : AcceptedRunId : 6000786    Language : C    Author : qq1203456195Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta 1 #include <stdio.h> 2 int main() 3 { 4 int n,i,f; 5 char str[101]; 6 while (gets(str)!=NULL) 7 { 8 i=0;f=1; 9 while (str[i]!='\0') 10 { 11 if (f==1) 12 { 13 printf("%c",str[i]-32); 14 f=0; 15 } 16 else 17 { 18 printf("%c",str[i]); 19 } 20 i++; 21 if(str[i]==' ') 22 { 23 printf(" "); 24 f=1; 25 i++; 26 } 27 } 28 printf("\n"); 29 } 30 return 0; 31 }

 

转载于:https://www.cnblogs.com/CheeseZH/archive/2012/05/26/2519010.html

相关资源:数据结构—成绩单生成器

最新回复(0)