@TGGC sagte in 1 bis 100 Centbeträge Möglichkeiten/Kombinationen Algorithmus: @Schlangenmensch int calc(int s, int l, int* c) { if (l < 2) return s % c[l] ? 0 : 1; if (s < c[l] ) return calc(s,l-1, c); return calc(s,l-1,c) + calc(s-c[l],l,c); } Da! Darum geht es! Mach daraus int calc(int s, int l, int* c) { if (l < 1) return s % c[l] ? 0 : 1; if (s < c[l]) return calc(s,l-1, c); return calc(s,l-1,c) + calc(s-c[l],l,c); } und alles ist viel logischer.