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. for (int j = 1; j <= m; ++j) {
  9. cin >> mat[i][j];
  10. }
  11. }
  12. for (int i = 1; i <= n; ++i) {
  13. int imp = 1;
  14. for (int j = 1; j <= m; ++j) {
  15. if (mat[i][j] % 2 == 0) {
  16. imp = 0;
  17. break;
  18. }
  19. }
  20. if (imp == 1) {
  21. cout << i << " ";
  22. }
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5284KB
stdin
4 4
1 3 5 1
3 3 3 1
2 3 5 3
5 6 3 5
stdout
1 2