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 1142. Relations

Why does my program not work?
Posted by Teh Ming Han 26 May 2002 20:29
// USU Problem 1142
// Relation
// Done by Teh Ming Han

#include <iostream.h>

int main(){
    int i,n;
    unsigned long fact[10];

    fact[1] = 1;
    for (i=2;i<=10;i++)
        fact[i] = fact[i-1]*i;

    while (!cin.eof()){
        cin>>n;
        if (n>=1) cout<<(fact[n]*(n-1))+1<<endl;
        else break;
    }
    return 0;
}
Re: Why does my program not work?
Posted by Dilyan 1 May 2005 15:57
the problem is not in your code. your idia is wrong.
i looked at your sors. it will only work when there is only one sign '='.

Edited by author 01.05.2005 16:01