CSES - Putka Open 2015 – 1/6 - Results
Submission details
Task:Aita
Sender:
Submission time:2015-07-18 16:21:40 +0300
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:11:10: error: expected initializer before '>>' token
      cin >> a >> b;
          ^
input/code.cpp:14:9: error: 'String' was not declared in this scope
         String aita = "";
         ^
input/code.cpp:16:13: error: 'aita' was not declared in this scope
             aita += i;
             ^
input/code.cpp:20:13: error: 'aita' was not declared in this scope
             aita += i;
             ^
input/code.cpp:24:21: error: 'aita' was not declared in this scope
             cout << aita;
                     ^
input/code.cpp:10:12: warning: unused variable 'k' [-Wunused-variable]
     int n, k,
            ^

Code

#include <iostream>
#include <stdlib.h>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int n, k,
     cin >> a >> b;


        String aita = "";
        for (int i = 1; i < n + 1; i+= 2) {
            aita += i;
        }

        for (int i = 2; i < n + 1; i+= 2) {
            aita += i;
        }

        if (n != 2) {
            cout << aita;
        } else {
           cout << "QAQ";
        }
}