fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int num1, num2, sum, diff;
  5.  
  6. scanf("%d", &num1);
  7.  
  8. scanf("%d", &num2);
  9.  
  10. sum = num1 + num2;
  11. diff = num1 - num2;
  12.  
  13. printf("和: %d\n", sum);
  14. printf("差: %d\n", diff);
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5280KB
stdin
10
5
stdout
和: 15
差: 5