fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int n,tablica[n];
  5. cin >> n;
  6. cin >> tablica[0]
  7. for (int k = 0;k <= n; k++){
  8. cin >> tablica[k];
  9. }
  10. cout << tablica[0] <<" ";
  11. for (int j = 0;j <= n; j++) {
  12. if (j % 2 == 0){
  13. cout << tablica[j] << " ";
  14. }
  15. }
  16. cout << endl;
  17. for (int j = 0;j <= n; j++) {
  18. if (j % 2 != 0){
  19. cout << tablica[j] << " ";
  20. }
  21. }
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
6 3 5 2 2 10 1
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7:2: error: expected ‘;’ before ‘for’
  for (int k = 0;k <= n; k++){
  ^~~
prog.cpp:7:17: error: ‘k’ was not declared in this scope
  for (int k = 0;k <= n; k++){
                 ^
stdout
Standard output is empty