- 博客(13)
- 收藏
- 关注
原创 C Primer Plus编程练习答案(Chapter9)
9.11.1#include <stdio.h>double min(double F1, double F2) { return (F1 > F2) ? F2 : F1;}int main() { double f1, f2; printf("Please enter two float number: "); scanf_s("%lf %lf", &f1, &f2); printf("the min of f1 and f2 is: %.2lf
2022-01-03 15:34:17 421
原创 C Primer Plus编程练习答案(Chapter7)
7.12.1#include <stdio.h>int main() { int score1 = 0, score2 = 0, score3 = 0; char ch; printf("Please enter strings(enter'#'to quit): "); scanf_s("%c", &ch); while (ch != '#') { if (ch == ' ') score1++; else if (ch == '\n') s
2022-01-03 11:05:02 558
原创 C Primer Plus编程练习答案(Chapter6)
6.16.1#include <stdio.h>int main() { char alphabet[26]; int i; for (i = 0; i < 26; i++) alphabet[i] = 'a' + i; for (i = 0; i < 26; i++) printf("%c ", alphabet[i]); return 0;}6.16.2#include <stdio.h>int main().
2022-01-02 22:01:06 199
原创 C Primer Plus编程练习答案(Chapter5)
5.11.1#include<stdio.h>#define N 60 int main() { float min, hour, sec; printf("Please enter minute(<=0 quit):"); scanf_s("%f", &min); while (min > 0) { hour = min / N; sec = min * N; printf("There are %.2f hours.\n", hou
2022-01-02 17:21:28 248
原创 C Primer Plus编程练习答案(Chapter4)
4.8.1#include<stdio.h>int main() { char name_first[20], name_last[20]; printf("Please enter your firstname:"); scanf_s("%s", name_first, 20); printf("Please enter your lastname:"); scanf_s("%s", name_last, 20); printf("%s,%s", name_firs..
2021-10-22 19:42:36 146
原创 C Primer Plus编程练习答案(Chapter3)
3.11.1/*存疑*/#include<stdio.h>int main() { int overflow_int = 32767; float overflow_above_float = 3.4e36; float overflow_below_float = -3.4e36; printf("整数上溢的情况是%d", overflow_int + 1); printf("浮点数上溢的情况是%f", overflow_above_float * 10000.0);
2021-10-18 20:35:00 155
原创 C Primer Plus编程练习答案(Chapter2)
2.12.1#include<stdio.h>int main(){ printf("XXxx_MR\n"); printf("XXxx_\nMR\n"); printf("XXxx_"); printf("MR"); return 0;}2.12.2#include<stdio.h>int main(){ printf("XXxx_MR\n"); printf("Room 2999,The N
2021-10-07 21:10:00 180
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人