c how to program 习题 3.18

c how to program 习题 3.18

运行结果: C语言代码: /* c how to program 习题 3.18 */ #include <stdio.h> #include <stdlib.h> int main() { //定义变量 double sales, salary, baseSalary = 200, royalty = 0.09; //请输入第一个职工销 ...

c how to program 习题 3.17

c how to program 习题 3.17

运行结果: C语言代码: /* c how to program 习题 3.17 */ #include <stdio.h> #include <stdlib.h> int main() { //定义变量 int accountNumber; double beginningBalance, totalCharges, totalCredits, credi ...

c how to program 习题3.16

c how to program 习题3.16

运行结果: C语言代码: /* c how to program 习题3.16 */ #include <stdio.h> #include <stdlib.h> int main() { //分别定义变量:燃油量,里程数,总的燃油量,总的里程数,油耗比,平均油耗比 float gallon, mile ...

C语言常用英语单词

C语言常用英语单词

从小不学好,长大卖电脑!英语单词都不认识几个,没办法,一边学C,一边记吧。 include 包含 stdio 标准输入输出 main 主要的 void 空的 function 函数 功能 作用 initialization 初始化 execution 执行 processing 处理 t ...

c how to program 习题2.31

c how to program 习题2.31

//c how to program 习题2.31 #include <stdio.h> int main( void ) { int number = 0; printf("number\tsqure\tcube\n"); printf("%d\t%d\t%d\n", number, number*number, number*number*number); number = number+1; printf("%d\t%d\t%d\n", number, nu ...

c how to program 习题2.30

c how to program 习题2.30

//c how to program 习题2.30 #include <stdio.h> int main( void ) { printf("请输入一个5位的整数:"); int number, temp; scanf("%d", &number); int a, b, c, d, e; temp = number; a = temp / 10000; temp = number % 10000; b = temp / 1000 ...

c how to program 习题2.29

c how to program 习题2.29

//c how to program 习题2.29 #include <stdio.h> int main( void ) { printf("请输入一个字符:"); char key; scanf("%c", &key); printf("%c的整数值是:%d\n", key, key); }

c how to program 习题2.28

c how to program 习题2.28

//c how to program 习题2.28 #include <stdio.h> int main( void ) { printf("* * * * * * * *\n"); printf(" * * * * * * * *\n"); printf("* * * * * * * *\n"); printf(" * * * * * * * *\n"); printf("* * * * * * * *\n"); printf(" * * * * * * * ...

c how to program 习题2.26

c how to program 习题2.26

//c how to program 习题2.26 #include <stdio.h> int main(void) { int x, y; printf("请输入两个整数:"); scanf("%d%d", &x, &y); if(x%y == 0){ printf("%d是%d的倍数\n", x, y); printf("%d是%d的%d倍\n", x, y, x / y); } if(x%y != 0 ...

c how to program 习题2.25

c how to program 习题2.25

//c how to program 习题2.25 #include <stdio.h> int main(void) { printf(" P\n"); printf(" P\n"); printf("PPPPPPPPP\n"); printf(" P\n"); printf(" P\n\n"); printf(" PPPP\n"); printf(" P P\n"); printf(" ...