Accepted
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 14:51:43
- Judged At
- 2024-11-11 03:46:08
- Judged By
- Score
- 100
- Total Time
- 0ms
- Peak Memory
- 408.0 KiB