Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Devoir de Java:
- * Calcul de factoriel 100, et 2^100
- * Réalisé par : KENFAOUI ILIASS
- */
- import java.math.*;
- public class BigIn
- {
- public static void main (String [] args)
- {
- System.out.println("\n-------------------------");
- System.out.println("Calcul de 100 factoriel :");
- System.out.println("-------------------------");
- BigInteger A = BigInteger.valueOf(1);
- for(int i = 2; i<=100; i++)
- A = A.multiply(BigInteger.valueOf(i));
- System.out.println("100! = " + A.toString()+"\n");
- System.out.println("\n----------------");
- System.out.println("Calcul de 2^100 :");
- System.out.println("----------------");
- BigInteger B = BigInteger.valueOf(2).pow(100);
- System.out.println("2^100 = " + B.toString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement