Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. public static void main(String args []){
  2. int a = in.nextInt();
  3. int b = in.nextInt();
  4. int c = in.nextInt();
  5. int x;
  6. System.out.println("Числа в переменных a, b и c : " + a + " " + b + " " + c);
  7. if (a > b) {
  8. x = a; a = b; b = x;
  9. }
  10. if (b > c){
  11. x = b; b = c; c = x;
  12. }
  13. System.out.println("Возрастающая последовательность: " + a + " " + b + " " + c);
  14. }
  15.  
  16. public static void main(String args []){
  17. int a = in.nextInt();
  18. int b = in.nextInt();
  19. int c = in.nextInt();
  20. int x;
  21. System.out.println("Числа в переменных a, b и c : " + a + " " + b + " " + c);
  22. if (a > b) {
  23. x = a; a = b; b = x;
  24. }
  25. if (b > c){
  26. x = b; b = c; c = x;
  27. }
  28. System.out.println("Возрастающая последовательность: " + a + " " + b + " " + c);
  29. }
  30.  
  31. public static void main(String[] args) {
  32.  
  33. int a = in.nextInt();
  34. int b = in.nextInt();
  35. int c = in.nextInt();
  36. int x;
  37.  
  38. if (a > b) {
  39. x = a; a = b; b = x;}
  40. else a = a;
  41. if (b > c){
  42. x = b; b = c; c = x;}
  43. else b=b;
  44. if (a > b) {
  45. x = a; a = b; b = x;}
  46. else c= c;
  47.  
  48. System.out.println("Возрастающая последовательность:" + a + " " + b + " " + c);
  49. }
  50.  
  51. }
  52.  
  53. int[] array = {a, b, c};
  54. var min = array[0];
  55. for (var i; i < 3; i++)
  56. {
  57. if (min > array[i])
  58. min = array[i]
  59. }
  60.  
  61. public static void main(String args []){
  62. int a = in.nextInt();
  63. int b = in.nextInt();
  64. int c = in.nextInt();
  65.  
  66. int min = Math.min(Math.min(a,b),c)
  67. int max = Math.max(Math.max(a,b),c)
  68. b = (a + b + c) - min - max; a = min; c = max;
  69.  
  70. System.out.println("Возрастающая последовательность: " + a + " " + b + " " + c);
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement