Loading...
Submission
Id When Author Problem Language CPU Memory Verdict
16904 2024-04-22 20:21:18 prottoy Max Number C 1 ms 1528 kb Accepted
Test Cases
CPU Memory Verdict
1 0 ms 1512 kb Accepted
2 0 ms 1504 kb Accepted
3 0 ms 1428 kb Accepted
4 0 ms 1504 kb Accepted
5 0 ms 1504 kb Accepted
6 0 ms 1512 kb Accepted
7 1 ms 1528 kb Accepted
Source Code
program.c
Download
  1. #include <stdio.h>
  2.  
  3. int max(int a, int b, int c) {
  4.  
  5. if (a > b && a > c) {
  6. return a;
  7. } else if (b > c) {
  8. return b;
  9. } else {
  10. return c;
  11. }
  12. }
  13.  
  14. int main() {
  15. int test_cases;
  16. scanf("%d", &test_cases);
  17. for (int i = 0; i < test_cases; i++) {
  18. int a, b, c;
  19. scanf("%d %d %d", &a, &b, &c);
  20. int maximum = max(a, b, c);
  21. printf("%d\n", maximum);
  22. }
  23.  
  24. return 0;
  25. }
  26.  
  27.