daily pastebin goal
38%
SHARE
TWEET

AF

a53 Oct 21st, 2018 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <fstream>
  2. using namespace std;
  3. ifstream f("af.in");
  4. ofstream g("af.out");
  5.  
  6. int main()
  7. {
  8.     int n;
  9.     f>>n;
  10.     long long int nr1,nr2,nr3;
  11.     char semn,egal;
  12.     while(n--)
  13.     {
  14.         f>>nr1>>semn>>nr2>>egal>>nr3;
  15.         switch(semn)
  16.         {
  17.             case '+': if(nr1+nr2==nr3) g<<"Adevarat"; else g<<"Fals";break;
  18.             case '-': if(nr1-nr2==nr3) g<<"Adevarat"; else g<<"Fals";break;
  19.             case 'x': if(nr1*nr2==nr3) g<<"Adevarat"; else g<<"Fals";break;
  20.             case ':': if(nr2&&nr1/nr2==nr3) g<<"Adevarat"; else g<<"Fals";break;
  21.         }
  22.         g<<'\n';
  23.     }
  24.     return 0;
  25. }
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