QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#682579#7779. Swiss Stagezyq_313#Compile Error//C++14477b2024-10-27 16:10:412024-10-27 16:10:43

Judging History

你现在查看的是最新测评结果

  • [2024-10-27 16:10:43]
  • 评测
  • [2024-10-27 16:10:41]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;


void solve(){
    int x, y;
    cin >> x >> y;
    if(x==0) {
    	if(y==0) cout<<4<<endl;
    	if(y==1) cout<<4<<endl;
    	if(y==2) cout<<6<<endl;
	} 
	if(x==1) {
		if(y==0) cout<<3<<endl;
		if(y==1) cout<<3<<endl;
		if(y==2) cout<<4<<endl;
	}
	if(x==2) {
		cout<<2<<endl;
	}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t = 1;
  //  cin >> t;
    while (t --) solve();
}

Details

answer.code: In function ‘void solve()’:
answer.code:22:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   22 | int main(){
      |         ^~
answer.code:22:9: note: remove parentheses to default-initialize a variable
   22 | int main(){
      |         ^~
      |         --
answer.code:22:9: note: or replace parentheses with braces to value-initialize a variable
answer.code:22:11: error: a function-definition is not allowed here before ‘{’ token
   22 | int main(){
      |           ^
answer.code:27:2: error: expected ‘}’ at end of input
   27 | }
      |  ^
answer.code:6:13: note: to match this ‘{’
    6 | void solve(){
      |             ^