답안 #16810

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
16810 2015-09-30T05:42:26 Z khsoo01 카드 (tutorial6) C++
컴파일 오류
0 ms 0 KB
#include "friends.h"

void jeehak (int A[]) {
  int tmp=A[1]^A[2]^A[3]^A[4]^A[5];
  send(tmp/2+1,tmp%2);
}
#include "friends.h"

void friends (int A[],int N,int X[],int Y[]) {
  int i,tmp=0;
  for(i=1;i<=5;i++) {
    if(A[i]!=-1)tmp^=A[i];
  }
  return ((X[1]-1)*2+Y[1])^tmp;
}

Compilation message

jeehak.cpp: In function ‘void jeehak(int*)’:
jeehak.cpp:5:21: error: ‘send’ was not declared in this scope
   send(tmp/2+1,tmp%2);
                     ^

friends.cpp: In function ‘void friends(int*, int, int*, int*)’:
friends.cpp:8:28: error: return-statement with a value, in function returning 'void' [-fpermissive]
   return ((X[1]-1)*2+Y[1])^tmp;
                            ^
grader_friends.c: In function ‘int main()’:
grader_friends.c:46:15: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 scanf("%d",&t);
               ^
grader_friends.c:52:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 scanf("%d",&__listn__[i]);
                          ^
grader_friends.c:53:68: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 for(j=1;j<=__listn__[i];j++)scanf("%d%d",&__X__[i][j],&__Y__[i][j]);
                                                                    ^
grader_friends.c: At global scope:
grader_friends.c:18:12: warning: ‘__now__’ defined but not used [-Wunused-variable]
 static int __now__;
            ^