제출 #20401

#제출 시각아이디문제언어결과실행 시간메모리
20401KEIST (#35)채점 시스템 (OJUZ11_judge)C++98
100 / 100
46 ms1116 KiB
#include<stdio.h> long long findjari(long long x, long long jari) { if (x==0) return jari; return findjari(x/10, jari+1); } int main() { long long query; scanf("%d", &query); while(query--) { long long correct, score; scanf("%lld %lld", &score, &correct); long long jari=findjari(score, 0); if (jari==0) jari++; long long defaultJari=1; for (long long i=1; i<=jari; i++) { defaultJari*=10; } long long cnt=0; while(1) { if ((score+defaultJari)>correct) { printf("%lld\n", cnt); break; } cnt++; defaultJari*=10; } } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

judge.cpp: In function 'int main()':
judge.cpp:10:20: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
  scanf("%d", &query);
                    ^
judge.cpp:10:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &query);
                     ^
judge.cpp:14:39: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld %lld", &score, &correct);
                                       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...