## Search found 8 matches

Tue Jun 21, 2005 9:09 pm
Forum: Algorithms
Topic: HELP: Factorials
Replies: 3
Views: 1052

### tnx

Thank you all. I totally misunderstood the problem.
Thu Jun 16, 2005 2:45 pm
Forum: Algorithms
Topic: HELP: Factorials
Replies: 3
Views: 1052

### HELP: Factorials

I must find the last non zero digit of n! #include <cstdio> int find_last(int x) { while (x%10==0) x/=10; return x%10; } int fact(int x) { int sol=1; for (int i=1;i<=x;i++) sol=find_last(find_last(i)*find_last(sol)); return sol; } int main(void) { int n; scanf("%d",&n); printf("%d\n",fact(n)); retur...
Sun Jun 12, 2005 2:41 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 25529

### tnx

It works...Tnx
Thu Jun 09, 2005 6:40 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 25529
I learned something new. You can't do this - float==something :D ,and I understand why you suggested EPS. Please PM the changed code so i can see what changes have you made...I was having MUCH trouble finding out my error, got tired and made BigNum -> got AC, so I think my error is not algorithmic. ...
Thu Jun 09, 2005 2:08 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 25529

if (input<EPS) break; Program should stop if input<EPS...Why did you put "?" My program had wrong results after last coin was used.That was because my coins array was wrong. The correct one is: int coins[]={1, 2, 4, 10, 20, 40, 100, 200, 400, 1000, 2000 }; Finaly, my code was not accepted even with...
Thu Jun 09, 2005 2:14 am
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 25529

CODE REMOVED
Wed Jun 08, 2005 1:22 am
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 25529