c-primer-plus
KocCaiJin
还是有梦想的吧。
展开
-
C Primer Plus 第8章 字符输入/输出和验证输入 编程练习
1.#include <stdio.h>int main(){ char ch; int ct = 0; while ((ch=getchar()) != EOF) ct++; printf("%d characters read.", ct); return 0;}2.#include <stdio.h>int main(){原创 2017-05-16 12:53:18 · 426 阅读 · 0 评论 -
C Primer Plus 第9章 函数 编程练习
复习题:8.int choice(int a,int b,int c){ int max; max = a; if (b > max) max = b; if (c > max) max = c; return max;}9.#include <stdio.h>void menu(void);int choice原创 2017-05-24 12:35:18 · 450 阅读 · 0 评论 -
C Primer Plus 第10章 数组和指针 编程练习
这章感觉好难啊,放个别人的总结.// 多维数组和指针#include <stdio.h>int main(void){ int zippo[4][2] = {{2, 4}, {6, 8}, {1, 3}, {5, 7}}; /* zippo[0]是一个整数大小对象的地址,而zippo是两个整数大小对象的地址。 因为(一个)整数和两个整数组成的数组开始原创 2017-05-24 12:45:47 · 663 阅读 · 0 评论 -
C Primer Plus 第6章 C控制语句:循环 编程练习
记录下写的最后几题。14.#include <stdio.h>int main() { double value[8]; double value2[8]; int index; for (index = 0; index < 8; ++index) { //输入值。 printf("value #%d:", index + 1);原创 2017-05-09 17:35:47 · 548 阅读 · 0 评论 -
C Primer Plus 第7章 C控制语句:分支和跳转 编程练习
作业练习1.#include <stdio.h>int main(void) { char ch; int spare, other, n; //空格,其他字符,换行 spare = other = n = 0; while ((ch = getchar()) != '#') { if (ch == ' ') spare++;原创 2017-05-11 23:30:26 · 340 阅读 · 0 评论