Search found 1 match

by fsafs168
Fri May 25, 2012 7:29 pm
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 25829

Re: 674 - Coin Change

Accepted????Why? this is my code: #include <iostream> #include <stdio.h> #include <string.h> using namespace std; int a[10000]={1,1}; int b[5]={1,5,10,25,50}; int main() { int i,j; for(i=0;i<5;i++) { for(j=2;j<10000;j++) { if(j>=b[i]) a[j]+=a[j-b[i]]; } } int n; while(scanf("%d",&n)!=EOF) { if(n==0)...

Go to advanced search