CSES - Datatähti 2018 alku - Results
Submission details
Task:Bittijono
Sender:ArktinenKarpalo
Submission time:2017-10-05 19:57:47 +0300
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:9:2: error: expected ';' before 'if'
  if(n==1)
  ^
input/code.cpp:11:2: error: 'else' without a previous 'if'
  else if(n==2)
  ^
input/code.cpp:12:8: error: expected ';' before numeric constant
   cout 11;
        ^
input/code.cpp:12:10: warning: statement has no effect [-Wunused-value]
   cout 11;
          ^
input/code.cpp:14:8: error: expected ';' before numeric constant
   cout 10;
        ^
input/code.cpp:14:10: warning: statement has no effect [-Wunused-value]
   cout 10;
          ^
input/code.cpp:16:8: error: expected ';' before numeric constant
   cout 1111;
        ^
input/code.cpp:16:12: warning: statement has no effect [-Wunused-value]
   cout 1111;
            ^
input/code.cpp:18:8: error: expected ';' before numeric constant
   cout 110;
        ^
input/code.cpp:18:11: warning: statement has no effect [-Wunused-value]
   cout 110;
           ^
input/code.cpp:20:8: error: expected ';' before numeric constant
   cou...

Code

#include <bits/stdc++.h>

using namespace std;

int n;

int main() {
	cin >> n
	if(n==1)
		cout 1;
	else if(n==2)
		cout 11;
	else if(n==3)
		cout 10;
	else if(n==4)
		cout 1111;
	else if(n==5)
		cout 110;
	else if(n==6)
		cout 101;
	else if(n==7)
		cout 1110;
	else if(n==8)
		cout 1101;
	else if(n==9)
		cout 1011;
	else if(n==10)
		cout 1010;
}