/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 0ms 320.0 KiB
#2 Accepted 0ms 320.0 KiB
#3 Accepted 0ms 316.0 KiB
#4 Accepted 0ms 324.0 KiB
#5 Accepted 0ms 324.0 KiB
#6 Accepted 0ms 324.0 KiB

Code

#include <stdio.h>

int main() {
    int a, b, c, d;

    // Taking user input for four integers
    scanf("%d %d %d %d", &a, &b, &c, &d);

    // Find the lowest and largest numbers
    int lowest = (a < b) ? ((a < c) ? ((a < d) ? a : d) : ((c < d) ? c : d)) : ((b < c) ? ((b < d) ? b : d) : ((c < d) ? c : d));
    int largest = (a > b) ? ((a > c) ? ((a > d) ? a : d) : ((c > d) ? c : d)) : ((b > c) ? ((b > d) ? b : d) : ((c > d) ? c : d));

    printf("%d\n", lowest);
    printf("%d\n", largest);

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1022 Minmax
Contest
Brain booster - 1
Language
C99 (GCC 13.2.0)
Submit At
2023-12-31 15:48:09
Judged At
2024-11-11 03:45:23
Judged By
Score
100
Total Time
0ms
Peak Memory
324.0 KiB