1

My input is of 10^19 ; How can i store this number.

int input ; // Of order 10^19;
int answer = input%(10^10+3)

How to perform above operations and what if i want to have an array

A[input][input] // showing me an error

3 Answers3

6

You should check out BigInteger

ControlAltDel
  • 33,923
  • 10
  • 53
  • 80
0

Instead of int, declare it as long. Its maximum value is of 2^63-1

Check this: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html

Guest
  • 83
  • 2
  • 9
0
BigInteger input; 
BigInteger answer = input%(10^10+3)
incr3dible noob
  • 441
  • 2
  • 14