fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int mat[100][100], n, m;
  6. cin >> n >> m;
  7. for (int i = 1; i <= n; ++i) {
  8. int findEven = 0;
  9. for (int j = 1; j <= m; ++j) {
  10. cin >> mat[i][j];
  11. if (mat[i][j] % 2 == 0) {
  12. ++findEven;
  13. }
  14. }
  15. if (findEven == 0) {
  16. cout << i << " ";
  17. }
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5288KB
stdin
6 8
1 2 3 4 5 6 7 8
9 1 3 5 3 7 9 7
1 2 0 9 3 1 4 6
3 2 1 5 5 2 1 3
11 2 1 4 5 6 1 9
1 2 4 2 1 34 5 1
stdout
2