Holey_yan

20141223_KUAS_VisualC++_Exam10

Dec 22nd, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. /**************************************/
  2. /** 20141223 Exam 10                 **/
  3. /** Maker  : Yan                     **/
  4. /** E-Mail : [email protected] **/
  5. /** Date   : 2014/12/23 am.11:32     **/
  6. /**************************************/
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <ctype.h>
  11.  
  12. int main(int argc, char const *argv[])
  13. {
  14.     FILE *fptrIn = fopen("Data.txt", "r");
  15.  
  16.     while(!feof(fptrIn))
  17.     {
  18.         char temp = NULL;
  19.         temp = fgetc(fptrIn);
  20.         if(islower(temp))
  21.             putchar(toupper(temp));
  22.         else if(isupper(temp))
  23.             putchar(tolower(temp));
  24.         else if(isdigit(temp))
  25.             putchar(temp);
  26.     }
  27.     fclose(fptrIn);
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment