| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
|* |
Run Code Online (Sandbox Code Playgroud)
我需要为Gambler's Ruin问题打印类似上面的ASCII图.利益和目标被视为args.最左边的 代表0美元,最右边| 代表目标,*代表现金.我的计划如下:
public class RuinPath {
public static void main(String[] args) {
// TODO - Your solution
int stake = Integer.parseInt(args[0]); // gambler's stating bankroll
int goal = Integer.parseInt(args[1]); // gambler's desired bankroll
{
int i = 0;
if (i …Run Code Online (Sandbox Code Playgroud)