|
|
back to boardwhat is wrong? #include <cstdlib> #include <iostream> using namespace std; int main() { int k=0,n,i,s=1,j; char c[50]; cin>>n;
if(n>=1 && n<=10) { cin.get(c,20); for(i=0;i<20;i++){ if(c[i]=='!') k=k+1; }
if(k>=1 && k<=20){
if(n%k!=0) { for(j=0;j<=(n-1)/k;j++) s=s*(n-j*k); cout<<s; } else if(n%k==0) { for(int j=0;j<=n/k;j++) s=s*(n-j*k); cout<<s; } }}
return 0; } |
|
|