fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. char card_name[3];
  6. scanf("%2s", card_name);
  7. int val = 0;
  8. switch(card_name[0]){
  9. case 'K':
  10. case 'Q':
  11. case 'J':
  12. val = 10;
  13. break;
  14. case 'A':
  15. val = 11;
  16. break;
  17. default:
  18. val = atoi(card_name);
  19. }
  20. return 0;
  21. }
  22.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:18:9: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration]
   val = atoi(card_name);
         ^~~~
prog.c:20:1: error: expected declaration or statement at end of input
 }
 ^
prog.c:7:7: warning: variable ‘val’ set but not used [-Wunused-but-set-variable]
   int val = 0;
       ^~~
stdout
Standard output is empty