kth004   7년 전

컴파일러 에러가 왜 나오는지 이유를 모르겠네요.

yclock   7년 전

아마 23번째 줄에 int(arr[i]) 부분이 문제인 것 같습니다.

C대신 C++11을 사용하는 것은 어떨까요?

sgchoi5   7년 전

https://www.acmicpc.net/help/judge 에 가시면 compile 옵션이 있습니다.

http://gooddaytocode.blogspot.kr/2016/09/compile.h... 에 가시면 간단히 test 할 수 있는 방법이 있습니다.


C 인 경우

goodday@DESKTOP-70ILJRL:~$ gcc Main.c -o Main -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
Main.c: In function ‘main’:
Main.c:21:17: error: expected expression before ‘int’
         point = int(arr[i]) - 97;//아스키코드로 소문자 a는 97이므로 97을 빼줌으로써 위치 찾음.
                 ^
Main.c:10:10: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", arr);
          ^

C++ / C++11 인 경우
goodday@DESKTOP-70ILJRL:~$ g++ Main.cc -o Main -O2 -Wall -lm --static -DONLINE_JUDGE
Main.cc: In function ‘int main()’:
Main.cc:10:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s", arr);
                     ^
sunggyu@DESKTOP-70ILJRL:~$


댓글을 작성하려면 로그인해야 합니다.