Submission #161144

# Submission time Handle Problem Language Result Execution time Memory
161144 2019-11-01T00:00:49 Z Doda COCI17_cezar (COCI17_cezar) C++14
Compilation error
0 ms 0 KB
#include <iostream>

using namespace std;


int k[20];
int main () {
int N,x,a,y,u,n;
cin >> N ;
for (int i = 2; i<14;i++){
	k[i] = 4;
}
for (int i = 0; i<N ; i++){
	cin	>> n;
	x += n;
	k[n] -= 1;
}
y = 21 - x ;
for (int i = y;i<14;i++){
	u += k[i];
}
for (int i = 0;i<y+1;i++){
	a += k[i];
}
int u = u;
int a = a;
if (u>a) {
	cout << "DOSTA";
}
else{
	cout << "VUCI";
}
return 0;
}

Compilation message

cezar.cpp: In function 'int main()':
cezar.cpp:25:5: error: redeclaration of 'int u'
 int u = u;
     ^
cezar.cpp:8:13: note: 'int u' previously declared here
 int N,x,a,y,u,n;
             ^
cezar.cpp:26:5: error: redeclaration of 'int a'
 int a = a;
     ^
cezar.cpp:8:9: note: 'int a' previously declared here
 int N,x,a,y,u,n;
         ^