How to deal with really BIG numbers in JAVA?

Write here if you have problems with your Java source code

Moderator: Board moderators

Post Reply
.pandre.
New poster
Posts: 9
Joined: Mon Nov 08, 2004 10:58 pm
Location: Coimbra, Portugal

How to deal with really BIG numbers in JAVA?

Post by .pandre. » Mon Nov 08, 2004 11:21 pm

[java] Does anyone know of any way to deal with those really BigNumber problems in JAVA?

Thank you[/java]

Maniac
Experienced poster
Posts: 105
Joined: Tue Oct 14, 2003 3:24 pm
Location: Utrecht, Holland

Post by Maniac » Wed Nov 10, 2004 10:44 am

Yes, I do. Make your own BigInteger class and use that :-) See other threads to find out how to implement a BigInteger class

.pandre.
New poster
Posts: 9
Joined: Mon Nov 08, 2004 10:58 pm
Location: Coimbra, Portugal

Post by .pandre. » Wed Nov 10, 2004 10:54 am

Maniac wrote:Yes, I do. Make your own BigInteger class and use that :-) See other threads to find out how to implement a BigInteger class
You mean you can submit several classes in the same file (like this:

class Xpto {
int atribute one;
int atribute two;
...

Xpto() {
}

public int methodOne() {
}
}

class Ypto{

public static void main(String args[]){
//code here
}
}


?
Does'nt this give you any error from the judge?

Anyway thanks a lot for your help

Maniac
Experienced poster
Posts: 105
Joined: Tue Oct 14, 2003 3:24 pm
Location: Utrecht, Holland

Post by Maniac » Wed Nov 10, 2004 11:00 am

Yes you can submit several classes in the same file and that is exactly what you should do :-)

Note that:
- you can't use inner classes cause Java 1.1 (or the stone age version the UVA Judge uses) doesn't support them
- your main class should still be called Main and that one must contain the public static void main method.

Post Reply

Return to “Java”