fork download
  1. #include <stdio.h>
  2.  
  3. void compareNumbers(int a, int b, int c) {
  4. // Check if all numbers are the same
  5. if (a == b && b == c) {
  6. printf("Isti se broevite\n");
  7. return;
  8. }
  9.  
  10. // Find the largest and smallest numbers
  11. int max_num = a;
  12. int min_num = a;
  13.  
  14. if (b > max_num) max_num = b;
  15. if (c > max_num) max_num = c;
  16.  
  17. if (b < min_num) min_num = b;
  18. if (c < min_num) min_num = c;
  19.  
  20. // Check if there are two largest numbers
  21. if ((a == max_num && b == max_num) ||
  22. (a == max_num && c == max_num) ||
  23. (b == max_num && c == max_num)) {
  24. printf("Isti maksimalni vnesovi\n");
  25. }
  26.  
  27. // Check if there are two smallest numbers
  28. if ((a == min_num && b == min_num) ||
  29. (a == min_num && c == min_num) ||
  30. (b == min_num && c == min_num)) {
  31. printf("Isti minimalni vnesovi\n");
  32. }
  33.  
  34. // Check if the difference between the smallest and largest is greater than 5
  35. if (max_num - min_num > 5) {
  36. printf("Dovolno odaleceni vnesovi\n");
  37. }
  38. }
  39.  
  40. int main() {
  41. int a, b, c;
  42.  
  43. // Input three integers
  44. printf("Vnesi prvi cel broj: ");
  45. scanf("%d", &a);
  46.  
  47. printf("Vnesi vtori cel broj: ");
  48. scanf("%d", &b);
  49.  
  50. printf("Vnesi tret cel broj: ");
  51. scanf("%d", &c);
  52.  
  53. // Compare the numbers
  54. compareNumbers(a, b, c);
  55.  
  56. return 0;
  57. }
Success #stdin #stdout 0s 5276KB
stdin
3 4 7
stdout
Vnesi prvi cel broj: Vnesi vtori cel broj: Vnesi tret cel broj: