Submission #20582

#TimeUsernameProblemLanguageResultExecution timeMemory
20582키-파 (#35)채점 시스템 (OJUZ11_judge)C++98
100 / 100
46 ms1116 KiB
#include <cstdio>

using namespace std;

int main() {
    int n;
    scanf("%d", &n);
    while (n--) {
        int t, p;
        scanf("%d%d", &t, &p);
        int temp = t;
        long long int p10 = 1;
        while (temp > 0) {
            p10 *= 10;
            temp /= 10;
        }
        if (t == 0) {
            p10 = 10;
        }
        int c = 0;
        while (p10 + t <= p) {
            ++c;
            p10 *= 10;
        }
        printf("%d\n", c);
    }
    return 0;
}

Compilation message (stderr)

judge.cpp: In function 'int main()':
judge.cpp:7:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
                    ^
judge.cpp:10:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d", &t, &p);
                              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...