QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#757541#7779. Swiss Stagejr_zlw#Compile Error//C++17600b2024-11-17 09:59:062024-11-17 09:59:07

Judging History

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

  • [2024-11-17 09:59:07]
  • 评测
  • [2024-11-17 09:59:06]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(a,b,c) for(int c(a);c<=(b);++c)
using namespace std;
inline void Solve()
{
	int x,y;
	scanf("%d%d",&x,&y);
	if(x==1&&y==0)
	{
		puts("3");
	}
	else if(x==0&&y==0)
	{
		puts("4");
	}
	else if(x==0&&y==1)
	{
		puts("4");
	}
	else if(x==0&&y==2)
	{
		puts("6");
	}
	else if(x==1&&y==1)
	{
		puts("3");
	}
	else if(x==1&&y==2)
	{
		puts("4");
	}
	else if(x==2&&y==0)
	{
		puts("2"); 
	}
	else if(x==2&&y==1)
	{
		puts("2");
	}
	else
	{
		puts("2");
	}
	return 0;
}
int main(){
	int T=1;
	while(T--)Solve();
	return 0;
}

Details

answer.code: In function ‘void Solve()’:
answer.code:44:16: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
   44 |         return 0;
      |                ^
answer.code:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%d%d",&x,&y);
      |         ~~~~~^~~~~~~~~~~~~~