please check my code... I'm sure that my code is correct for the foregone
solution but it says WA: test set 1 skipped test set 2 skipped ... can anyone
tell me why I'm getting this error plz verify my code and check manually
outputs... all outputs are satisfying plz tell me what is wrong with my code...
I'm finding an error in my code...thank you so much in advance...and sorry
about bad English
here is code in java...
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args){
int t,count=0,p,div,mt;
int N;int k,m=0,b,lsa=0,lsb=0,lsm=0;
Scanner j=new Scanner(System.in);
t=j.nextInt();
int i,ed=0;
for(i=1;i<=t;i++)
{
N=j.nextInt();
System.out.printf("Case #%d: ",i);
k=N;mt=N;
while(mt!=0)
{b=mt%10;
m=m*10+b; if(b==4) { lsa++;}
mt=mt/10;
}b=0;m=0;
if(lsa==0){System.out.printf("NO SOLUTION");}
else {
if(N%2==0){ div=N/2;
while(div!=0)
{
b=div%10;
m=m*10+b;
div=div/10;
if(b==4) { lsb++;}
}b=0;m=0;}
else { lsb++;}
if(lsb==0){System.out.printf("%d %d\n",N/2,N/2);}
else {
while(k!=0)
{
b=k%10;
m=m*10+b;
k=k/10;
}b=0;p=m;m=0;
while(p!=0)
{
b=p%10;
if(b==4){ b=1;}else {b=0;}
m=m*10+b;
p=p/10;
}b=0;int A=N-m;int B=m;
System.out.printf("%d %d\n",A,B);
m=0;lsb=0;lsa=0;
}
}
}
}
}
--
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/7dadb3bb-8c4f-4fdf-88d1-ca6cc416cd90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.