0 喜歡 0 不喜歡
485 瀏覽

Please fix the given code below:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
	
	$1 sticks = 9;
	int taken;
	int Player = 1;
	
	$2(sticks > 0){
		printf("Player %d -- Sticks remaining: %d",Player, sticks);
		printf("\nHow many sticks do you want to take (1-3): ");
		scanf("$3",&taken);
		
		while(taken>3$4taken<1){
			printf("\nHow many sticks do you want to take (1-3): ");
			scanf("%d",&taken);
		}
		sticks -= taken;
		
		Player++;
		
		if(Player==3){
			Player = 1;
		}
		
	}
	
	
	printf("****THE WINNER IS: Player %d !!****", $5);

	return 0;
}

 

 

[練習] 克漏字填空 - 最新提問 分類:Chapter 3: Branching, Looping and Functions | 用戶: (5.9k 分)
ID: 34344 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 485 瀏覽

17 個回答

0 喜歡 0 不喜歡
內容已隱藏
**

*
*
* *
80/100 最新回答 用戶: (192 分)
0 喜歡 0 不喜歡
內容已隱藏
**
**

%d
* * * **
100/100 最新回答 用戶: (281 分)
0 喜歡 0 不喜歡
內容已隱藏
**
****
**
**
*
80/100 最新回答 用戶: (244 分)
0 0
while -> all small characters :)
0 喜歡 0 不喜歡
內容已隱藏
***
*** *


*
100/100 最新回答 用戶: (221 分)
0 喜歡 0 不喜歡
內容已隱藏
*


*
* **
100/100 最新回答 用戶: (220 分)
0 喜歡 0 不喜歡
內容已隱藏
**
**
*
*
* *
80/100 最新回答 用戶: (183 分)
0 喜歡 0 不喜歡
內容已隱藏
*
**

**
* *
100/100 最新回答 用戶: (273 分)
0 喜歡 0 不喜歡
內容已隱藏
***
* *

%d
** * ** ** * *
**
80/100 最新回答 用戶: (269 分)
0 喜歡 0 不喜歡
內容已隱藏
*
***
*
*
**
100/100 最新回答 用戶: (153 分)
修改於 用戶:
0 喜歡 0 不喜歡
內容已隱藏
*
*

***
****
最新回答
修改於 用戶:
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.58.160
©2016-2024

相關問題

0 喜歡 0 不喜歡
18 回答
[練習] 多選題 - 最新提問 12月 2, 2017 分類:Chapter 3: Branching, Looping and Functions | 用戶: nat236919 (5.9k 分)
ID: 35364 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 568 瀏覽
0 喜歡 0 不喜歡
14 回答
[練習] 開放式問答 - 最新提問 11月 2, 2017 分類:Chapter 3: Branching, Looping and Functions | 用戶: nat236919 (5.9k 分)
ID: 30244 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 447 瀏覽
1 喜歡 0 不喜歡
23 回答
[練習] Coding (C) - 最新提問 10月 22, 2017 分類:Chapter 3: Branching, Looping and Functions | 用戶: semicolon (5.2k 分)
ID: 28184 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 1.3k 瀏覽
12,783 問題
183,443 回答
172,219 留言
4,824 用戶