fork download
  1. import java.until.Scanner;
  2. import java.math.BigInteger;
  3.  
  4. class Main { /* UVa 1230 - LA 4104 - MODEX, 0.189s in Java */
  5. public static void main(String[] args) {
  6. Scanner sc = new Scanner(System.in);
  7. int c = sc.nextInt();
  8. while (c-- > 0) {
  9. BigInteger x = BigInteger.valueOf(sc.nextInt()); // valueOf converts
  10. BigInteger y = BigInteger.valueOf(sc.nextInt()); // simple integer
  11. BigInteger n = BigInteger.valueOf(sc.nextInt()); // into BigInteger
  12. System.out.println(x.modPow(y, n)); // look ma, it's in the library ;)
  13. } } }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
3
2 3 5
4 7 10
98 2 34
compilation info
prog.cpp:1:1: error: 'import' does not name a type
 import java.until.Scanner;
 ^
prog.cpp:2:1: error: 'import' does not name a type
 import java.math.BigInteger;
 ^
prog.cpp:5:10: error: expected ':' before 'static'
   public static void main(String[] args) {
          ^
prog.cpp:5:27: error: 'String' has not been declared
   public static void main(String[] args) {
                           ^
prog.cpp:5:36: error: expected ',' or '...' before 'args'
   public static void main(String[] args) {
                                    ^
prog.cpp:13:5: error: expected ';' after class definition
 } } }
     ^
prog.cpp: In static member function 'static void Main::main(int*)':
prog.cpp:6:5: error: 'Scanner' was not declared in this scope
     Scanner sc = new Scanner(System.in);
     ^
prog.cpp:7:13: error: 'sc' was not declared in this scope
     int c = sc.nextInt();
             ^
prog.cpp:9:7: error: 'BigInteger' was not declared in this scope
       BigInteger x = BigInteger.valueOf(sc.nextInt()); // valueOf converts
       ^
prog.cpp:10:18: error: expected ';' before 'y'
       BigInteger y = BigInteger.valueOf(sc.nextInt()); // simple integer
                  ^
prog.cpp:11:18: error: expected ';' before 'n'
       BigInteger n = BigInteger.valueOf(sc.nextInt()); // into BigInteger
                  ^
prog.cpp:12:7: error: 'System' was not declared in this scope
       System.out.println(x.modPow(y, n)); // look ma, it's in the library ;)
       ^
prog.cpp:12:26: error: 'x' was not declared in this scope
       System.out.println(x.modPow(y, n)); // look ma, it's in the library ;)
                          ^
prog.cpp:12:35: error: 'y' was not declared in this scope
       System.out.println(x.modPow(y, n)); // look ma, it's in the library ;)
                                   ^
prog.cpp:12:38: error: 'n' was not declared in this scope
       System.out.println(x.modPow(y, n)); // look ma, it's in the library ;)
                                      ^
stdout
Standard output is empty