###### tags: `作業-進階` `大一程設` `東華大學` `東華大學資管系` `基本程式概念` `資管經驗分享` HW1-4 === ## Description 請撰寫一支程式,該程式一開始會隨機產生一個0至99的整數值為答案,接著讓使用者猜測該數,若使用者輸入的猜測值大於答案,則會輸出 “Too high!",若小於答案,則會輸出“Too low!",這兩種狀況下,會繼續讓使用者輸入下一個猜測值,直至某回合使用者的猜測值剛好等於答案時,會輸出 “Correct!"並結束程式。 ```cpp= #include <ctime> int main() { srand(time(NULL)); int Answer = rand() % 100;} ``` ## sample input and output 1 **程式每次亂數皆不同,請在自己電腦測試。** 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up