WA 판정

Kimtaewon Reply 8 years 48 weeks ago
이유가 먼가요?
persuade Reply 8 years 48 weeks ago
strcmp 함수의 결과값이 UNIX에서는 다르게 나오기 때문입니다. #include <stdio.h> void main() { char a[10] = "test"; char b[10] = "abc"; printf("strcmp between test and abc = %d\n", strcmp(a,b)); } 위 코드 결과로는 strcmp between test and abc = 19 이 나오게 됩니다.
persuade Reply 8 years 48 weeks ago
즉, UNIX에서는 크다 작다와 더불어 "얼마만큼 차이난다" 라는 추가 정보까지 제공해줍니다. result == 1 이렇게 코딩할 경우 정렬이 안될껍니다.