fork download
  1. #include <cstdio>
  2. #include <iostream>
  3. #include <cstring>
  4. using namespace std;
  5.  
  6. int main() {
  7. int n;
  8. while(scanf("%d", &n) != EOF) {
  9. printf("%d\n", n & 1);
  10. }
  11. return 0;
  12. }
Success #stdin #stdout 0s 3472KB
stdin
1
2
3
4
5
6
7
8
stdout
1
0
1
0
1
0
1
0