Submission #8221

# Submission time Handle Problem Language Result Execution time Memory
8221 2014-09-07T06:15:43 Z ansol4328 마술 (GCJ14_magic) C++
Compilation error
0 ms 0 KB
#include<stdio.h>

int main()
{
int i, j, k, n, a, m[6][6], cnt, out;
int list[4][6];

scanf("%d",&n);
for(k=1 ; k<=n ; k++)
{
cnt=0;
scanf("%d",&a);
for(i=1 ; i<=4 ; i++)
{
for(j=1 ; j<=4 ; j++)
{
scanf("%d",&m[i][j]);
if(i==a) list[1][j]=m[i][j];
}
}
scanf("%d",&a);
for(i=1 ; i<=4 ; i++)
{
for(j=1 ; j<=4 ; j++)
{
scanf("%d",&m[i][j]);
if(i==a) list[2][j]=m[i][j];
}
}
for(i=1 ; i<=4 ; i++) for(j=1 ; j<=4 ; j++) if(list[1][i]==list[2][j]) out=list[1][i], cnt++;
if(cnt==0) printf("Case #%d: Volunteer cheated!\n",i);
if(cnt==1) printf("Case #%d: %d\n",i,out);
if(cnt>=2) printf("Case #%d: Bad magician!\n",i);
}
return 0;

Compilation message

magic.cpp: In function 'int main()':
magic.cpp:35:9: error: expected '}' at end of input
magic.cpp:8:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
magic.cpp:12:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
magic.cpp:17:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
magic.cpp:21:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
magic.cpp:26:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]