You are viewing a single comment's thread. Return to all comments →
public static int howManyGames(int p, int d, int m, int s) { // Return the number of games you can buy
int n=0; while(s-p>=0) { n++; s-=p; p-=d; if(p<=m) { p=m; } } return n; }
Seems like cookies are disabled on this browser, please enable them to open this website
Halloween Sale
You are viewing a single comment's thread. Return to all comments →
public static int howManyGames(int p, int d, int m, int s) { // Return the number of games you can buy