You are not logged in. Please login at www.codechef.com to post your questions!

×

why am i getting nzec in this question

package codechef; import java.util.Scanner; public class ans { public static int help(int n) { int ans=0; int a=n; int d=0; int ten=1; while(a!=0) { d++; ten=ten10; a=a/10; } int div=ten/10; int mod=10000007; for(int i=0;i<d;i++) { ans+=n; //ans%=mod; /int add=n/10; n=n%10; n=ndiv+add;/ int rem=n%div; n=n/div; n=rem*10+n;

        if(i!=d-1) {
            ans*=ten;
        }
    }   
    return ans;

}
public static void main(String[] args) {
    Scanner s=new Scanner(System.in);
    int t=s.nextInt();
    for(int i=0;i<t;i++) {
        int n=s.nextInt();
        System.out.println(help(n));
    }

    }


}

asked 24 Dec '18, 15:59

svasundhara's gravatar image

1★svasundhara
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×555
×102

question asked: 24 Dec '18, 15:59

question was seen: 34 times

last updated: 24 Dec '18, 15:59