fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long double x, y, z, min, max;
  6. int counter, number;
  7. counter = 1;
  8. number = 1;
  9. cin >> x >> y >> z;
  10. min = 0;
  11. min = x;
  12. if(y < min){
  13. min = y;
  14. counter = 1;
  15. }
  16. else if(y == min){
  17. counter ++;
  18. }
  19. if(z < min){
  20. min = z;
  21. counter = 1;
  22. }
  23. else if (z == min){
  24. counter++;
  25. }
  26. max = 0;
  27. max = y;
  28. if(x > max){
  29. max = x;
  30. number = 1;
  31. }
  32. else if(x == max){
  33. number ++;
  34. }
  35. if(z > max){
  36. max = z;
  37. number = 1;
  38. }
  39. else if(z == max){
  40. number ++;
  41. }
  42. if(counter !=1 ){
  43. cout << min << "("<<counter<<")" << endl;
  44. }
  45. else {
  46. cout << min << endl;
  47. }
  48. if(number != 1){
  49. cout << max << "("<<number<<")" << endl;
  50. }
  51. else {
  52. cout << max << endl;
  53. }
  54. return 0;
  55. }
Success #stdin #stdout 0s 3416KB
stdin
1 2 2
stdout
1
2(2)