2 #include <stdio.h> #define VALUE(X,Y) (1/((1/(X)+1/(Y))/2)) int main() { double x,y; puts("请输入 2 个数: "…
C Primer Plus [第六版]第15章编程练习题答案
1 #include <stdio.h> #include <limits.h> #include <string.h> #define SLEN 33 //输入 char *s_ge…
C Primer Plus [第六版]第14章编程练习题答案
1 #include <stdio.h> #include <string.h> int days_s(char *st); struct month { char month_a[20]; ch…
C Primer Plus [第六版]第14章复习题答案
3 struct month { char month_a[20]; char month_b[3]; int days; int month_c; };
C Primer Plus [第六版]第13章编程练习题答案
1 //使用标准 I/O #include <stdio.h> #include <stdlib.h> //提供 exit() 原型 int main() { int ch; //读取文件时, 储…
C Primer Plus [第六版]第13章复习题答案
4 #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]…
fopen与fopen_s打开文件区别
fopen: FILE * fp; fp = fopen(文件名,"r"); 打开文件成功的话返回文件指针(赋值给fp),打开失败则返回NULL值。 fopen_s: FILE * fp; errno_t …
C Primer Plus [第六版]第12章编程练习题答案
1 #include <stdio.h> void critic(int *n); int main() { int units; printf("多少磅重的黄油?\n"); scanf_s("%d", &a…
C语言用循环和递归计算汉诺塔
/* 汉诺塔移动次数为2^n-1次 用循环写的话直接先计算次数 然后判断奇数偶数套规律 */ #include <stdio.h> static int i = 1; void judge1(int n, c…
C Primer Plus [第六版]第11章编程练习题答案
1 #include <stdio.h> void strinput(char *st, int n); int main() { char input[20]; strinput(input, 20); p…