|
|
вернуться в форумWA test 1 Послано Freddy 23 май 2013 23:29 what'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 Послано Elias 3 май 2014 21:30 try adding '\n' to the output |
|
|