This is the first ever programmer i have tried in java.after learning basics… But i am getting error saying that NZEC.Then i found out that this was related to return type or other return problem…can anyone help me in removing this error.i have written the code below.plz give me a immediate reply\
**
import java.util.Scanner;
class Codechef
{
public static void main (String[] args)
{
int ctr; int n;double a[]=new double[20];
Always provide the problem link while asking for a doubt.
There are two problems in your code:
According to the constraints, 1 <= T <= 10^{5}, but you have declared your array to be of size 20. So, change the size of the array to 10^{5}.
The data type of your array is double, but you are trying to get the last digit of the number by taking the mod and dividing it by 10. This method works only with integers, not with floating-point value. So, change the data type of the array to int.
After doing these changes, your code will work fine.
Hey, you don’t need to award any points. By this, you are losing your karma. You can rather upvote and accept an answer. This way, you will gain karma points and still be grateful.
Please refrain from using award point feature of forum for accepting answer. Just click on that “tick in circle” below “thumbs down button” to accept his answer and grant him the deserved karma.