ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1083. Factorials!!!

WA test 1
Posted by Freddy 23 May 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
Posted by Elias 3 May 2014 21:30
try adding '\n' to the output