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…
自行设计函数判断输入内容是否正确
#include <stdio.h> #include <stdbool.h> #include <string.h> #define ANSWER "Grant" #define S…
C Primer Plus [第六版]第10章编程练习题
课后:数组这一章说难不难,说简单不简单,知识点有点多,需要慢慢消化,很多东西都理解,但是看到题目后不是很懂哪个意思,明白之后一点就通,主要还是需要多练习,数组的表示法和指针表示法方法有点多。 1 //计算每年的总降水量、…
C Primer Plus [第六版]第9章编程练习题答案
1 #include <stdio.h> double min(double x, double y); int main() { double a, b, c; printf("请输入2个浮点数: "); …