自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 c primerplus 第十章编程题答案

//第一题 #include <stdio.h> #include <stdlib.h> #define MONTHS 12 #define YEARS 5 int main(void) { const float rain[YEARS][MONTHS] = { { 4.3, 4.3, 4.3, 3.0, 2.0, 1.2, 0.2, 0.2, 0.4, 2.4, 3.5, 6.6 }, { 8.5, 8.2, 1.2,

2020-08-03 23:47:02 747

原创 c primer plus第九章习题

//第一题 #include <stdio.h> double h(double a, double b); int main(void) { double min, a, b; scanf("%lf %lf", &a, &b); min = h(a, b); printf("%f\n", min); return 0; } double h(double a, double b){ if(a >= b) return b; else

2020-07-25 16:44:05 250

原创 c primer plus 第七章笔记+习题

//第一题 #include <stdio.h> int main(void) { char ch; int blank = 0, line_feed = 0, other = 0; while((ch = getchar())!='#'){ if(ch == ' ') blank++; else if(ch == '\n') line_feed++; else other++; } printf("blank = %d, l.

2020-07-21 16:40:21 771

原创 c primer plus第六章笔记+习题

1、 ```c #include <stdio.h> int main(void) { char alpha[26] = {'a', 'b', 'c'}; //懒得写了 int i; for(i = 0; i < 26; i++) printf("%c ", alpha[i]); return 0; } 2、 #include <stdio.h> int main(void) { int i, j; for(

2020-07-18 11:18:35 808

原创 c primer plus第五章笔记+习题

****1、 #include <stdio.h> int main(void) { int n, h, m; const int a = 60; printf("请输入大于0的分钟数\n"); scanf("%d", &n); while(n > 0){ h = n / a; m = n % a; printf("%d是%d小时%d分钟\n", n, h, m); scanf("%d", &n); //如果不加这行,就会一直循环 } retu

2020-07-16 12:16:42 249

原创 c primer plus第四章笔记+习题

printf(“%2.2f”, 2.345e2); //输出234.50 输出一个左对齐、字符宽度为6、最少有4位数字的十进制整数 %-6.4d //转换说明中小数点前的数字指明字段宽度,小数点后的数字指明精度 输出一个形如0x8a、字段宽度为4的十六进制整数 %#4x **1、#include <stdio.h> #include <string.h> int main(void) { char ming[40], xing[40]; printf(“请输入名和姓\n”);

2020-07-15 21:11:50 957

原创 C primer plus第三章笔记+习题

单精度float,在32位机器上用4个字节来存储的;双精度double是用8个字节来存储的。 浮点数后加F\f,程序会将类型视为float long long int简写为long long bool函数,true 1/ false 0 赋值①定义时同时初始化 ②运行过程中赋值 ③scanf 1、#include <stdio.h> int main(void) { int a = 99999999999999999999999999999999999999999999999999999999.

2020-07-15 21:08:53 1853

原创 C primer plus第二章 笔记

关键字:不能作为变量名 eg.main是函数名 c语言基本模块是函数 注意/n(打印/n)和\n(换行)

2020-07-15 21:05:11 193

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除