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

Compilation error
Posted by Elmurod 23 Oct 2008 18:23
#include <iostream.h>
using namespace std;

int main()
{
int n,k,fact;
string s;
cin>>n;
getline(cin,s) ;
k = s.length()-1;
fact = n;
if ((n % k) != 0)
{
for (int i = 1; (n - i*k) >= (n % k); i++)
fact *= (n-i*k);
}
else if ((n % k) == 0)
{
for (int i = 1; (n - i*k) >= k; i++)
fact *= (n-i*k);
}
cout<<fact;
}


// Why Compilation error???