Code Submission Evaluation System Login

Datatähti 2017 loppu

Start:2017-01-19 12:15:00
End:2017-01-19 17:15:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - Datatähti 2017 loppu - Results
History
2017-01-19 17:14:46
2017-01-19 17:13:52
2017-01-19 17:13:20
2017-01-19 17:12:40
Task:Ohjelma
Sender:gokuha
Submission time:2017-01-19 17:14:46
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:11:9: warning: unused variable 'o' [-Wunused-variable]
 for(int o=0; n!=1; i++){
         ^
input/code.cpp:20:12: error: expected ';' before '}' token
 cout<<"END"}
            ^

Code

#include<iostream>
#include<vector>
using namespace std;
int main(){
int n;
cin>>n;
vector<string> p;
if (n%3==0){
cout<<0;}
int i=0;
for(int o=0; n!=1; i++){
	if (n%3==1){
		n-=3;
		p[i]="ADD";}
	else{if (n%2==0){
		n/=2;
		p[i]="MUL"; }}} 
for (int j=p.size()-1; j>=0; j--){
	cout<<p[j];}
cout<<"END"}