C teaching

时间:2021-03-03 02:45:44

L1 Preparation

1. environment

codeblocks

2.variable, const

3. data type

int     "%d"
char "%c" (ASCAII)
float "%f"

4. printf

string: "helloworld"
number & expression
\n

5. calculation

+-*/

6. sequence, branch and cycle

=
if, switch
for, while, do-while

7. example

1) score to grade
90-100:A
70- 89:B
60- 69:C
0- 59:D 2) add 1:n 3) easy calculation
1 2 +

8. homework

1) read a list of scores from some file and print relative grades into another file

try your best to complete the request above. If you can't learn file operation anyway, you can just scanf from console

2) realize a calculator
easy: 12 * 8
hard: 127-12