fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main (void)
  4. {
  5. int num;
  6. char ch;
  7.  
  8. printf("輸入整數\n");
  9. scanf("%d",&num);
  10.  
  11. printf("輸入字元\n");
  12. scanf(" %c",&ch);
  13.  
  14. printf("num is %d and ASCII of ch= %d\n.",num,ch);
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 5284KB
stdin
12 k
stdout
輸入整數
輸入字元
num is 12 and ASCII of ch= 107
.