SHARE
TWEET

Untitled

a guest Aug 25th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<fstream>
  2. using namespace std;
  3. ifstream cin("af.in");
  4. ofstream cout("af.out");
  5. unsigned long long i,a,b,ok,c,n;
  6. char egal,semn;
  7. int main()
  8. {
  9.     cin>>n;
  10.     for(i=1;i<=n;i++)
  11.     {
  12.         cin>>a>>semn>>b>>egal>>c;
  13.         if(semn=='+')
  14.           {
  15.             if(a+b==c)ok=1;
  16.              else ok=0;
  17.           }
  18.          else if(semn=='-')
  19.         {
  20.             if(a-b==c)ok=1;
  21.               else ok=0;
  22.         }
  23.           else if(semn=='x')
  24.         {
  25.             if(a*b==c)ok=1;
  26.              else ok=0;
  27.         }
  28.          else if(semn==':')
  29.         {
  30.             if(b==0)ok=0;
  31.              else if(a/b==c)ok=1;
  32.                     else ok=0;
  33.         }
  34.         //else ok=0;
  35.         if(ok==1)cout<<"Adevarat"<<"\n";
  36.          else cout<<"Fals"<<"\n";
  37.     }
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top