/ SeriousOJ /

Record Detail

Compile Error

foo.c: In function 'main':
foo.c:11:19: error: conflicting types for 'x'; have 'long long int'
   11 |         long long x = p - q;
      |                   ^
foo.c:7:19: note: previous declaration of 'x' with type 'int'
    7 |         int l, r, x;
      |                   ^
foo.c:11:23: error: 'p' undeclared (first use in this function)
   11 |         long long x = p - q;
      |                       ^
foo.c:11:23: note: each undeclared identifier is reported only once for each function it appears in

Code

#include <stdio.h>

int main() {
    int t;
    scanf("%d", &t);
    while (t--) {
        int l, r, x;
        scanf("%d %d %d", &l, &r, &x);

        long long q = l;
        long long x = p - q;

        if (p >= l && p <= r) {
            printf("%d %d\n", p, q);
        } else {
            printf("-1 -1\n");
        }
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1186 Equal to X
Contest
Brain Booster #9
Language
C99 (GCC 13.2.0)
Submit At
2025-04-06 16:36:46
Judged At
2025-04-06 16:36:46
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes