/ SeriousOJ /

Record Detail

Compile Error

foo.c: In function 'main':
foo.c:23:1: error: expected declaration or statement at end of input
   23 | }
      | ^

Code

#include <stdio.h>

int main() {
    int T; 
    scanf("%d", &T);

    while (T--) {
        int N, D, A, B;
        scanf("%d %d", &N, &D);
        scanf("%d %d", &A, &B);
        
        int total_cost = 0;
        if (N <= D) {
            total_cost = N * A;
        } else{
            total_cost = D * A;
            total_cost += (N - D) * B;
        }

        printf("%d\n", total_cost);

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1090 Summer trip
Contest
Brain Booster #5
Language
C99 (GCC 13.2.0)
Submit At
2024-09-05 15:55:42
Judged At
2024-11-11 03:02:19
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes