fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5.  
  6. int COMV(int X)
  7. {
  8. int i,z;
  9. char X1[10];
  10.  
  11. sprintf(X1, "%i",X);
  12.  
  13. for (i=0; i<strlen(X1); i++)
  14. {
  15. if (X1[i] == 7)
  16. {
  17. X1[i] = 0;
  18. }
  19.  
  20. }
  21. z = atoi(X1);
  22.  
  23. return z;
  24. }
  25.  
  26. int main()
  27. {
  28.  
  29. int N,M,T1,T2,T;
  30. int r,r1;
  31. char Op[10];
  32.  
  33. scanf("%d",&N);
  34. scanf("%s",Op);
  35. scanf("%d",&M);
  36.  
  37.  
  38. r = COMV(N);
  39. r1 = COMV(M);
  40.  
  41. if (strcmp(Op,"+") == 0)
  42. {
  43. T = r+r1;
  44. T1 = COMV(T);
  45. printf("%d\n",T1);
  46. }
  47. if (strcmp(Op,"X") == 0)
  48. {
  49. T2 = r*r1;
  50. T2 = COMV(T);
  51. printf("%d\n",T2);
  52. }
  53.  
  54.  
  55. return 0;
  56. }
  57.  
Success #stdin #stdout 0s 9416KB
stdin
7 x 4
stdout
Standard output is empty