ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

What is wrong in my code?please help me,it's really annoyed me(
Posted by Aidos 24 Jun 2011 00:27
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.math.BigInteger;
public class Main {
    public static void main(String[] args) throws IOException {
        //String filename="myFile.txt";
        StreamTokenizer sTokenizer = null;
        BigInteger [] big;int i=0;
        double[] dmas =new double[131072];
        int wordCount = 0, numberCount = 0;
            sTokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
            while (sTokenizer.nextToken() != StreamTokenizer.TT_EOF) {
                if (sTokenizer.ttype == StreamTokenizer.TT_NUMBER){
            dmas[i]=Math.sqrt(sTokenizer.nval);i++;
                }
                       }
            for(int j=i;j>=0;j--){
             System.out.printf("%.4f\n",dmas[j]);
            }
        }
}
Re: What is wrong in my code?please help me,it's really annoyed me(
Posted by AterLux 24 Jun 2011 15:57
for(int j=i-1;j>=0;j--){