|
|
вернуться в форумWhat should I do?Who can save the poor guy? Here's my code,and I don't know what's wrong with it? #include<iostream> using namespace std; char s[25]; int main() { __int64 n,k; while(scanf("%I64d%s",&n,s)!=-1) { k=strlen(s); if(n<=k) { printf("%I64d\n",n); } else { __int64 sum=1,i; if(n%k==0) { for(i=n;i>=k;i-=k) sum*=i; } else { for(i=n;i>=n%k;i--) sum*=i; } printf("%I64d\n",sum); } } return 0; } Edited by author 15.06.2013 12:54 Edited by author 15.06.2013 12:56 Re: What should I do?Who can save the poor guy? Solved!My apology! Re: What should I do?Who can save the poor guy? Solved!My apology! |
|
|