|
|
back to boardCompilation 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??? |
|
|