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个浮点数: "); …
C Primer Plus [第六版]第9章复习题第9题
#include <stdio.h> void menu(void); int number(int a, int b); int main() { int a = 1, b = 4; int u; bk:m…
【C语言】分别用循环和递归以二进制形式打印整数
//以二进制形式打印整数 #include <stdio.h> void to_binary(unsigned long n); void fo_binary(unsigned long n); int ma…
【C语言】可以计算多组数值方差的小程序
#include<stdio.h> #include<math.h> int main() { double x[50]; double m, m_1, m_2, s; int i, j; m =…
C Primer Plus [第六版]第8章编程练习题答案
1 #include <stdio.h> int main() { int n; char ch; n = 0; while ((ch = getchar()) != EOF) { n++; } printf…
C Primer Plus [第六版]第7章编程练习题答案
1 #include <stdio.h> int main() { char ch; int a, b, c; a = 0; b = 0; c = 0; printf("请输入内容[#退出]: "); whi…
将输入字符转换为大小写字符程序
#include <stdio.h> #include <ctype.h> // tolower() 返回小写 toupper() 返回大写 函数原型库 #include <stdbool.…