|  | 
|  | 
| back to board | WA test 1 Posted by Freddy  23 May 2013 23:29what's wrong with my code? i tried a few test cases and the result is good.#include<stdio.h>
 int main()
 {
 int num,n=0;
 int res=1;
 char a;
 scanf("%d ",&num);
 while(scanf("%c",&a)==1)
 n++;
 for(int i=num%n;i<=num;i+=n)
 {
 if(i==0)
 i=n;
 res=res*i;
 }
 printf("%d",res);
 }
 
 Edited by author 23.05.2013 23:39
Re: WA test 1 Posted by Elias  3 May 2014 21:30try adding '\n' to the output | 
 | 
|