A brother you do us a favor, help me to see where the wrong? How changes
Users questions: importjava.io.*;classpaixu{publicstaticvoidmain(String[]args)throwsIOException{BufferedReaderbr=newB : "); for (i = 0; in 10, i + +) str = br.readLine (), x [i] = Integer.parseInt (str); for (i = 9; in -1; in ** ) System.out.pri ntln (10-i +":"+ x [i ]);}} prompt an error message G: * javacaogao javacpaixu.javapaixu.java: 13: can not initialize the variable strx [i] = Integer.par seInt (str); ^ 1 error
Experts answer: after I helped debug landlord, the program is missing a pair of braces. Should read as follows: importjava.io .*; classpaixu (publicstaticvoidmain (Strin g[]args)throwsIOException{BufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));String str; inti, x [] = newint [10]; System.out.print ("Please enter 10 integers:"); for (i = 0; i 10; i ++){** str brace is missing here = br.readLine (); x [i] = Integer.parseInt (str );}** here for lack of the right brace for (i = 9; i -1; i **) System.out.println (10-i +":"+ x [ i ]);}} results if necessary by from the large Small output, the procedure should be as follows (if the result should be output by small to large, please landlord own debug): importjava.io .*; importjava.util .*; classpaixu (publicstaticvoidmain (S tring[]args)throwsIOException{BufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));St nteger.parseInt (str);) Arrays.sort (x); ** on the array from small to large order for (i = 9; i -1; i **)** beginning with the largest output of the array System. out.println (1 0-i +":"+ x [i ]);}}