답안 #275359

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
275359 2020-08-20T05:41:25 Z 문홍윤(#5111) Happiness (Balkan15_HAPPINESS) C++17
컴파일 오류
0 ms 0 KB
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

Compilation message

grader.cpp: In function 'int main()':
grader.cpp:14:9: warning: unused variable 'd' [-Wunused-variable]
   14 |  int i, d;
      |         ^
grader.cpp:15:12: warning: unused variable 'max_code' [-Wunused-variable]
   15 |  long long max_code;
      |            ^~~~~~~~
grader.cpp:17:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   17 |  scanf("%d%lld", &N, &M);
      |  ~~~~~^~~~~~~~~~~~~~~~~~
grader.cpp:19:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   19 |   scanf("%lld", &coins[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~
grader.cpp:23:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   23 |  scanf("%d", &Q);
      |  ~~~~~^~~~~~~~~~
grader.cpp:26:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   26 |   scanf("%d%d", &ck, &c);
      |   ~~~~~^~~~~~~~~~~~~~~~~
grader.cpp:28:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   28 |    scanf("%lld", &A[j]);
      |    ~~~~~^~~~~~~~~~~~~~~
/tmp/cc9WvP1x.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccEWFvDS.o:happiness.cpp:(.text.startup+0x0): first defined here
/tmp/cc9WvP1x.o: In function `main':
grader.cpp:(.text.startup+0x6d): undefined reference to `init(int, long long, long long*)'
grader.cpp:(.text.startup+0xff): undefined reference to `is_happy(int, int, long long*)'
collect2: error: ld returned 1 exit status