|
|
вернуться в форумWA in JAVA - Why? Послано Kirill 22 янв 2016 13:26 import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.*; public class Try2 { public static void main(String[] args) { DecimalFormatSymbols s = new DecimalFormatSymbols(); s.setDecimalSeparator('.'); DecimalFormat f = new DecimalFormat("#,####0.0000",s); Scanner in = new Scanner(System.in); while (in.hasNextLong()) { System.out.println(f.format(Math.sqrt(in.nextLong()) )); } } } Re: WA in JAVA - Why? Task: > For each number Ai from the last one till the first one ... So, did you try to check your solution on sample? Did you notice that numbers in your answer are in the wrong order? Re: WA in JAVA - Why? Послано Kirill 22 янв 2016 14:44 oh, thanks! Re: WA in JAVA - Why? So, did You solve this problem with sqrt in wrong order? If You did, explain how? |
|
|