fork download
  1.  
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6. float x, y;
  7.  
  8. if (scanf("%f", &x) && scanf("%f", &y))
  9. {
  10. int sum = x + y;
  11. int diff = x - y;
  12. int mul = x * y;
  13. if (x == (int)x && y == (int)y)
  14. {
  15. if (y != 0)
  16. {
  17. int delenie = x / y;
  18. printf("%d %d %d %d\n", sum, diff, mul, delenie);
  19. }
  20. else
  21. {
  22. printf("%d %d %d n/a\n", sum, diff, mul);
  23. }
  24. }
  25. else
  26. {
  27. printf("n/a\n");
  28. }
  29. }
  30. else
  31. printf("n/a\n");
  32.  
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0s 5284KB
stdin
8 2.5
stdout
n/a