Submission #33584


Source Code Expand

Copy
#include <stdio.h>

int main(void){
	int B, in[6], i, cnt=0, rank;
	bool E[10]={false}, L[10]={false};
	scanf("%d%d%d%d%d%d",&in[0],&in[1],&in[2],&in[3],&in[4],&in[5]);
	for(i=0; i<=5; i++)
		E[in[i]]=true;
	scanf("%d", &B);
	scanf("%d%d%d%d%d%d",&in[0],&in[1],&in[2],&in[3],&in[4],&in[5]);
	for(i=0; i<=5; i++)
		L[in[i]]=true;
	for(i=0; i<=9; i++)
		if(E[i] && L[i])
			cnt++;
	rank=(cnt==6)?1:(cnt>=3)?(8-cnt):0;
	if((cnt==5)&&(L[B]))
		rank=2;

	printf("%d\n",rank);

	return 0;
}

Submission Info

Submission Time
Task A - 宝くじ
User hiyoko
Language C (GCC 4.4.7)
Score 0
Code Size 508 Byte
Status CE

Compile Error

./Main.c: In function ‘main’:
./Main.c:5: error: ‘bool’ undeclared (first use in this function)
./Main.c:5: error: (Each undeclared identifier is reported only once
./Main.c:5: error: for each function it appears in.)
./Main.c:5: error: expected ‘;’ before ‘E’
./Main.c:8: error: ‘E’ undeclared (first use in this function)
./Main.c:8: error: ‘true’ undeclared (first use in this function)
./Main.c:12: error: ‘L’ undeclared (first use in this function)
./Main.c:6: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
./Main.c:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
./Main.c:10: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result