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!!!

Any Ideas why do not work (WA test 1)?
Posted by horhe13 9 Aug 2011 23:44
#include <stdio.h>

int main()
{
#ifndef ONLINE_JUDGE
   freopen("input.txt", "rt", stdin);
   freopen("output.txt", "wt", stdout);
#endif

    int L,a;
    int K = 0;
    int W;
    int C;
    scanf("%d", &L);
    getchar();
    C = getchar();
    while (C != EOF)
    {
        K++;
        C = getchar();
    }
    W = L;
    a = L;
    while (a-K > 0)
    {
        a -= K;
        W *= a;
    }
    printf("%d", W);
    return 0;
}