1.



/**
* FWP, Ausgew√¤hlte Probleme aus dem ACM Programming Contest, WS10/11
* Problem: 674 - Coin Change
* Link: http://uva.onlinejudge.org/external/6/674.pdf
*
* @author Philippe Brousse
* @version 1.0, 10/27/2010
*
* Method : Counting Change
* Status : Accepted
* Runtime: 1.764
*/
package coinchange;

import java.util.Scanner;

/**
*
* @author Philippe Brousse
*/
public class Main
{

/**
* @param Kommandozeilenargumente
*/
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
// M√¼nzwerte
final int[] coins = new int[]
{
50, 25, 10, 5, 1
};
// Anzahl m√∂glicher M√¼nzkombinationen f√¼r bis zu 7489 cents
long[] ways = new long[7490];
// 0 cent auf 1 art wechselbar
ways[0] = 1;
// Möglichkeiten berechnen
for (int coin : coins)
{
for (int j = coin; j <= 7489; j++)
{
ways[j] += ways[j - coin];
}
}
// Möglichkeit auslesen
while (input.hasNext())
{

int amount = input.nextInt();
System.out.println(ways[amount]);

}
input.close();
}
}



2.
/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 674 - Coin Change
* Link: http://uva.onlinejudge.org/external/6/674.html
*
* @author Barny Porcio
* @version 1.0, 05/09/2010
*
* Method : -
* Status : Accepted
* Runtime: 0.096
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class CoinChange674 {

public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] coin = {50,25,10,5,1};
int[] ans = new int[7490];
ans[0] = 1;
for (int i = 0; i < coin.length; ++i) {
for (int j = coin[i]; j < ans.length; j++){
ans[j] += ans[j-coin[i]];
}
}
while(br.ready()){
System.out.println(ans[Integer.parseInt(br.readLine())]);
}
}
}

2.

/** * FWP, Ausgewšhlte Probleme aus dem ACM Programming Contest, SS10
* * Problem: 674 - Coin Change
* * Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=8&page=show_problem&problem=615
* * Savkina Ekaterina
* * @version 1.0, 06/17/2010
* *Method : Ad-Hoc
* * Status : Accepted
* * Runtime: 0.932 */
package coins_change;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

public static int[] coins = { 50, 25, 10, 5, 1 };
static int MAX = 7489;

public static void main(String... args) throws NumberFormatException,
IOException {
BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
int v = 5;
int[] mway = new int[MAX + 1];
mway[0] = 1;
for (int i = 0; i < v; i++) {
int c = coins[i];
for (int j = c; j <= MAX; j++)
mway[j] += mway[j - c];
}
while (sc.ready()) {
int money = Integer.parseInt(sc.readLine());
// if (money == 0)
//break;


System.out.print(mway[money] + "\n");

}
}
}


2.

package acm_674_coin_change;

import java.util.Scanner;

/**
* FWP, Ausgew¶hlte Probleme aus dem ACM Programming Contest, SS10
* Problem: acm_674_coin_change
* Link:
*
* @author Martin Lambeck
* @version 1.0, 01.09.2010
*
* Method : dp
* Status : Accepted
* Runtime: 2.660
*/


public class Main
{
static Scanner sc = new Scanner(System.in);

final static int MAX = 7500;

static long[] w = new long[MAX+1];

public static void main(String... args)
{
w[0] = 1;

dp(1);
dp(5);
dp(10);
dp(25);
dp(50);


while (testcase())
;
}

public static boolean testcase()
{
if (!sc.hasNextInt())
return false;

int price = sc.nextInt();

System.out.printf("%d%n", w[price]);

return true;
}

static void dp(int c)
{
for (int i = 0; i <= MAX; i++)
{
if (i+c > MAX)
return;

w[i+c] += w[i];
}
}
}