c how to program 习题4.10

c how to program 习题4.10

运行结果: C语言代码: /* c how to program 习题4.10 ** 计算平均值 */ #include <stdio.h> #include <math.h> // function main begins program execution int main( void ) { //定义变量number为获取的整数,count为循环 ...

c how to program 习题4.9

c how to program 习题4.9

运行结果: C语言代码: /* c how to program 习题4.9 */ /*计算整数的和*/ #include <stdio.h> #include <math.h> // function main begins program execution int main( void ) { //定义变量number为整数的个数,count为累 ...

c how to program 习题3.45

c how to program 习题3.45

a) 运行结果: a) C语言代码: /* c how to program 习题3.45 */ #include <stdio.h> // function main begins program execution int main( void ) { //分别定义变量 int number = -1, temp = 1, count = 1; //获取num ...

c how to program 习题3.44

c how to program 习题3.44

运行结果: C语言代码: /* c how to program 习题3.44 */ #include <stdio.h> // function main begins program execution int main( void ) { //分别定义三条边长变量a,b,c int a, b, c; printf("请分别请入三条边a b ...

c how to program 习题3.43

c how to program 习题3.43

运行结果: C语言代码: /* c how to program 习题3.43 */ #include <stdio.h> // function main begins program execution int main( void ) { //分别定义三条边长变量a,b,c int a, b, c; printf("请分别请入三条边a b ...

c how to program 习题3.42

c how to program 习题3.42

运行结果: C语言结果: /* c how to program 习题3.42 */ #include <stdio.h> // function main begins program execution int main( void ) { //分别定义变量x,y int x, y; printf("请分别请入x y的值:"); scanf ...

c how to program 习题3.41

c how to program 习题3.41

运行结果: C语言代码: /* c how to program 习题3.41 */ #include <stdio.h> // function main begins program execution int main( void ) { //分别定义变量半径,直径,周长,面积 float radius, pi = 3.14159; // ...

c how to program 习题3.40

c how to program 习题3.40

运行结果: C语言代码: /* c how to program 习题3.40 */ #include <stdio.h> // function main begins program execution int main( void ) { //定议变量number int number = 1; //当number不等于0执行循环 while ...

c how to program 习题3.39

c how to program 习题3.39

运行结果: C语言代码: /* c how to program 习题3.39 */ #include <stdio.h> // function main begins program execution int main( void ) { //定义变量x为控制一行*的数量,y为控制*的行数 int x , y = 0; //当行数 ...

c how to program 习题3.38

c how to program 习题3.38

运行结果: C语言代码: /* c how to program 习题3.38 */ #include <stdio.h> // function main begins program execution int main( void ) { //定义变量 用户输入的数值number 临时数值temp 累加count long int number, ...