⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 11.txt

📁 一個計算機系教授的上課講義 主要是教導學生使用C語言編寫程序
💻 TXT
字号:
CS 1355
Introduction to Programming in C
Monday 2006.10.16 (Week 6)
Lecture notes (at http://r638-2.cs.nthu.edu.tw/C/notes/11.txt)

Chapter 5 continued (pp.161-169)
- Book example: Game of Chance
- Enumerated data type
- Storage Classes (auto, register, extern, static)
- Scoping rules

Rule: Game of Chance
- roll two dice (each is 1, 2, 3, 4, 5, 6)
- on first throw:
   if sum is 7 or 11 => player wins
   if sum is 2, 3, 12 => player loses
   if sum is 4,5,6,8,9,10 => sum becomes point, throw again.
- on subsequent throw:
   if sum is 7 => player loses
   if sum is point => player wins
   all other sum => throw again.

How to solve this problem?
1. concept of "state" or "status" (

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -