C语言转换大小写

 
 
  1. #include<stdio.h>
  2. #include<ctype.h>//Containsthetolowerprototype
  3. voidmain(void)
  4. {
  5. intletter;
  6. for(letter=getchar();!feof(stdin);letter=getchar())
  7. putchar(tolower(letter));
  8. }

C语言转换大小写_第1张图片

 
 
  1. #include<stdio.h>
  2. #include<string.h>
  3. voidmain(void)
  4. {
  5. charline[255];//Lineoftextread
  6. while(fgets(line,sizeof(line),stdin))
  7. fputs(strupr(line),stdout);
  8. }

C语言转换大小写_第2张图片

本文出自 “阿凡达” 博客,请务必保留此出处http://shamrock.blog.51cto.com/2079212/878528

你可能感兴趣的:(C语言)