1182 - Parity
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; for(int cs = 1; cs <= t; cs++){ int x; cin >> x; if(__builtin_parity(x))cout << "Case "<<cs<< ": odd\n"; else cout << "Case "<<cs<< ": even\n"; } return 0; }
let's start Code
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; for(int cs = 1; cs <= t; cs++){ int x; cin >> x; if(__builtin_parity(x))cout << "Case "<<cs<< ": odd\n"; else cout << "Case "<<cs<< ": even\n"; } return 0; }
No comments:
Post a Comment