fork download
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main(){
  4. int a, b, kq;
  5. char pheptinh;
  6. scanf("%d %c %d =%d", &a, &pheptinh, &b, &kq);
  7. if((pheptinh == '+' && a + b == kq)|| (pheptinh == '-' && a - b == kq) || (pheptinh == '*' && a * b == kq) || (pheptinh == '/' && b != 0 && a / b == kq)){
  8. printf("YES");
  9. }
  10. else{
  11. printf("NO");
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
NO