public static void gramstoAtoms()
{
System.out.println("Enter Amount of grams");
Scanner keyboard = new Scanner(System.in);
long x = keyboard.nextLong();
System.out.println("Enter Unit Grams");
long y = keyboard.nextLong();
long result = x/y;
long answer = result*60200000000000000000000;
System.out.println(answer + "Atoms");
}
如何更改此代码,以免出现整数太长错误?