使用printf语句输出两个两位整数的四则运算式.c 321 B

1234567891011121314
  1. #include <stdio.h>
  2. int main() {
  3. int num1, num2;
  4. scanf("%d %d", &num1, &num2);
  5. printf("%d+%d=%d\n", num1, num2, num1 + num2);
  6. printf("%d-%d=%d\n", num1, num2, num1 - num2);
  7. printf("%d*%d=%d\n", num1, num2, num1 * num2);
  8. printf("%d/%d=%.0f\n", num1, num2, (float)num1 / num2);
  9. return 0;
  10. }