Could anyone tell me what's happening?I wrote:
And it says:
C:\Documents and Settings\Admini strator\My Documents\Untit led1.cpp In function 'int main()':
7 23 C:\Documents and Settings\Admini strator\My Documents\Untit led1.cpp [Error] expected ')' before ';' token
7 24 C:\Documents and Settings\Admini strator\My Documents\Untit led1.cpp [Error] expected primary-expression before ')' token
7 24 C:\Documents and Settings\Admini strator\My Documents\Untit led1.cpp [Error] expected ';' before ')' token
Why does this happened?
Tips:please send it before 2022/5/28, because that day is my coding class, I need to finish this question before the class.
Code:
#include<bits/stdc++.h>
using namespace std;
int days,gold,silver,copper,all,sum,sumg,sums,sumc;
int main(){
days<=17;
cin>>days;
for(int i;i<=days;i++;){
cin>>gold>>silver>>copper;
sumg=gold+sumg;
sums=silver+sums;
sumc=copper+sumc;
sum=sumg+sums+sumc;
}
cout<<days<<" "<<sumg<<" "<<sums<<" "<<sumc<<" "<<sum;
return 0;
}
C:\Documents and Settings\Admini strator\My Documents\Untit led1.cpp In function 'int main()':
7 23 C:\Documents and Settings\Admini strator\My Documents\Untit led1.cpp [Error] expected ')' before ';' token
7 24 C:\Documents and Settings\Admini strator\My Documents\Untit led1.cpp [Error] expected primary-expression before ')' token
7 24 C:\Documents and Settings\Admini strator\My Documents\Untit led1.cpp [Error] expected ';' before ')' token
Why does this happened?
Tips:please send it before 2022/5/28, because that day is my coding class, I need to finish this question before the class.
Comment