Search found 4 matches

by cjrr2046
Tue Dec 30, 2008 11:47 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 319833

Re: If you get WA in problem 100, read me before post!

import java.io.*;

public class Main
{
public static void main (String[] args)
{
final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line;
try
{
while ((line=reader.readLine ())!=null)
{
try
{
String[] words=line.split (" ");
int a=Integer.parseInt ...
by cjrr2046
Sun Dec 28, 2008 9:58 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 319833

Re: If you get WA in problem 100, read me before post!

Send this, get WA, dont know why. Works with the test cases i have found with any order (i>j and i<j)

import java.io.*;

public class Main
{
public static void main (String[] args) throws Exception
{
final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line ...
by cjrr2046
Sun Dec 28, 2008 9:08 pm
Forum: Java
Topic: How to I disply only 3 numbers after dot of double?
Replies: 3
Views: 4787

Re: How to I disply only 3 numbers after dot of double?

double a1=2.02356323; // Any double //
DecimalFormat df=new DecimalFormat ("0.000");
String a2=df.format (a1);
System.out.println (a2);

DecimalFormat is in this package: java.text.DecimalFormat;
by cjrr2046
Sun Dec 28, 2008 8:53 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 319833

Why WA???

Send this, get WA, dont know why. Works with the test cases i have found with any order (i>j and i<j)

import java.io.*;

public class Main
{
public static void main (String[] args) throws Exception
{
final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line ...

Go to advanced search