fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int n;
  7. cin >> n;
  8. int i =0 ;
  9. while (i<=n){
  10. i++;
  11. if(i%2==0){
  12. cout << i << endl;
  13. }
  14. else
  15. {
  16. cout << "-1" << endl;
  17. }
  18. }
  19. }
  20.  
  21.  
  22.  
Success #stdin #stdout 0.01s 5284KB
stdin
10
stdout
-1
2
-1
4
-1
6
-1
8
-1
10
-1