Cod sursa(job #3360785)
| Utilizator | Data | 16 iulie 2026 14:34:07 | |
|---|---|---|---|
| Problema | Fructe | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <fstream>
using namespace std ;
ifstream cin("fructe.in");
ofstream cout("fructe.out");
int main()
{
int t, b, p, n ;
cin >> t ;
for(int i = 1 ; i <= t ; i++) {
cin >> p >> b ;
n = p + b ;
if(n == 2) {
cout << 1 << endl ;
}
else {
if(b % 2 == 0) {
cout << 0 << endl ;
}
else{
cout << 1 << endl ;
}
}
}
return 0;
}
