package com.codegym.task.task04.task0420;
/*
Sorting three numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
String x=bf.readLine();
String y=bf.readLine();
String z=bf.readLine();
int a=Integer. parseInt(x);
int b=Integer.parseInt(y);
int c=Integer. parseInt(z) ;
if( a>b&&b>c)System.out.println(a+" "+b+" "+c);
else if(b>c&&c>a)System.out.println(b+" "+c+" "+a);
else if(c>a&& a>b)System.out.println(c+" "+a+" "+b) ;
else if(c>b&&b>a)System.out.println(c+" "+b+" "+a) ;
else if (a>c&c>b ) System.out.println(a+" "+c+" "+b) ;
else
System.out.println(b+" "+a+" "+c) ;
}
}
what's wrong with my code?
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Anthony Chalk
7 December 2019, 08:26
when you convert x and z to ints, there's a space between Integer. and parseInt
0