MUstar

IoT C언어 0522 - EX_2

May 22nd, 2017
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     char a[80];
  6.     int i, b=0;
  7.     printf("문자 입력 : ");
  8.     fgets(a,sizeof(a),stdin);
  9.     for(i=0;i<80;i++)
  10.     {
  11.         if((a[i]>=65)&&(a[i]<=90))
  12.         {
  13.             a[i] = a[i] + 32;
  14.             b++;
  15.         }
  16.     }
  17.     printf("바뀐 문장 : %s",a);
  18.     printf("바뀐 문자 수 : %d\n",b);
  19.     return 0;
  20. }
RAW Paste Data