标签:
1: int main()
2: {
3: /*
4: int score;
5: // 赋值操作(初始化)
6: score = 1000;
7:
8: score = 10000;
9:
10: char c;
11:
12: c = ‘A‘;
13:
14: int a = 20;
15:
16:
17: //int d,e,f;
18:
19: int b;
20:
21: b = a = 40;
22:
23: b = 30;*/
24:
25: // 变量:只要有不确定的数据, 就应该定义变量来保存
26: int score = 205;
27: // 1:15
28: int time = 75;
29:
30: int bestScore = 3161;
31:
32: // %d\%i是一个格式符(占位符),只能输出整数
33: printf("分数是%d\n", score);
34:
35:
36: float height = 1.78f;
37:
38: // %f用来输出小数,默认是6位小数
39: printf("身高是%.2f\n", height);
40:
41:
42: char scoreGrade = ‘D‘;
43: printf("积分等级是%c\n", scoreGrade);
44:
45:
46: printf("分数是%d,身高是%f,等级是%c\n", score, height, ‘C‘);
47:
48: return 0;
49: }
1: int temp = a;
2: a = b;
3: b = temp;
1: a = b - a;
2: b = b - a;
3: a = b + a;
标签:
原文地址:http://www.cnblogs.com/zeyang/p/4318323.html