Advertisement
namereq

c言語のif文の条件について

Jun 21st, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     int value;
  6.     char* key;
  7.     printf("入力:");
  8.     scanf("%d%s",&value, key);
  9.     switch(*key){
  10.         case 'a':
  11.             /* 処理1 */
  12.             break;
  13.         case 'b':
  14.             /* 処理2 */
  15.             break;
  16.         case 'c':
  17.             /* 処理3 */
  18.             break;
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement