I made a program in java at my local pc compiler. It ran successfully ,but when
i m trying to upload this same program on codejam compiler it is showing
runtime error . Can someone help me out with this please.
My code is:
import java.util.*;
import java.io.*;
class not_4
{
public void main()
{
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int i=1;i<=T;i++)
{
int N=sc.nextInt();
System.out.print("Case #"+i+": ");
splitNum(N);
}
}
public void splitNum(int N)
{
int org_num=0,new_num=0,c=0;
while(N!=0)
{
int r=N%10;
if(r==4)
{
org_num=org_num+(int)Math.pow(10,c)*2;
new_num=new_num+(int)Math.pow(10,c)*2;
}
else
{
org_num=org_num+(int)Math.pow(10,c)*r;
}
c++;
N=N/10;
}
System.out.println(org_num+" "+new_num);
}
}
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/66453798-2e31-4986-85b8-c6ff499ac3a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.