Description
Objective :
Learn to use if/else and switch statements to do decision making, then combine with for and while loops to perform some operations.
5.1
Write a program let the user input 4 distinct numbers ranging from 0 to 9, then output two values. One is ‘A’, indicating how many numbers are correct and in the right position. The other is ‘B’, indicating how many numbers are correct but in the wrong position. You have to guess the correct sequence within 10 tries. If not, the answer will be revealed.
Hint:random a number between 0123 and 9876.
Output :
5.2
Write a program let the user input an integer, and output the result with the digits in reverse order, then find the greatest common divisor of the two numbers..
Input:
875624
Output :
Please note:: users of visual studio add the following code to your program’s beginning
繳交格式及規定 : 程式重點地方請加註解,給分也會酌量參考註解。
請繳交 .c 檔即可。
c 檔的檔名一律統一,以學號為檔名壓縮成一個以學號為名的壓縮檔
上傳,
上傳請一律繳交壓縮檔。
Example: 若學號為 B123456789, 則.c/.cpp 檔名為 B123456789.c , 而壓縮檔名為 B123456789.rar。
繳交期限 2023.10.26 (四) 09:00 分之前,逾期一律不收,
無輸入輸出及逾期者一律以 0 分計算。
作業請上傳中山網路大學 網大上傳方式:
1. 點選要繳交的作業,選擇「進行作業」。
2. 依照流程上傳檔案。
Reviews
There are no reviews yet.