Now let me be very frank...I'm new to the world of programming and I've been recieving this NZEC run time error quite a lot...Almost in every problem I try..And I tell you its very frustating..Can anybody plz tell me how to fix this...i'm repeated getting NZEC in almost all codes I try
Here's my solution to ADDREV:
import java.io.*;
class REV
{
public static void main(String args[])throws IOException
{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
int x= Integer.parseInt(br.readLine());
while(x>0)
{x--;
String s=br.readLine();
String t= s.substring(0,s.indexOf(32));
String v=s.substring(s.indexOf(32)+1);
int c,m,i,a,b;
a=t.length();b=v.length();
if(a{c=a;
a=b;b=a;
s=v;
v=t;
t=s;
}
c=m=i=0;boolean flag=false;
a-=b;
while(b>0)
{b--;
c+=t.charAt(i)+v.charAt(i)-96;
m=c%10;
c/=10;
if(flag||m!=0){System.out.print(m);flag=true;}
i++;
}
while(a>0)
{a--;
c+=t.charAt(i)-48;
m=c%10;
c/=10;
if(flag||m!=0){System.out.print(m);flag=true;}
i++;
}
if(c!=0)System.out.print(c);
System.out.println();
}
}}