自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 C++ Primer Plus (第六版)第五章 编程练习

C++ Primer Plus (第六版 )第五章 编程练习

2023-07-03 20:33:31 196

原创 C++ Primer Plus第六版 第四章 编程练习

C++ Primer Plus 第六版 第四章 编程练习

2022-11-13 14:53:35 362

原创 C++ Primer Plus 第六版 第三章 编程练习

C++ Primer Plus 第六版 第三章编程练习

2022-10-16 15:40:38 427

原创 C++ Primer Plus 第六版 第二章 编程练习

C++ Primer Plus 第六版 第二章 编程练习

2022-10-08 10:35:01 1632

原创 C Primer Plus 第六版 第十六章 编程练习

C Primer Plus 第六版 第十六章 编程练习

2022-08-09 11:16:49 226

原创 C Primer Plus 第六版 第十五章 编程练习

C Primer Plus 第六版 第十五章 编程练习

2022-08-05 12:52:08 396

原创 C Primer Plus第六版 第十四章 编程练习

C Primer Plus 第六版 第十四章 编程练习

2022-06-28 19:38:56 474

原创 C Primer Plus 第六版 第十三章 编程练习

C Primer Plus 第六版第十三章 编程练习

2022-06-12 16:09:26 262

原创 C Primer Plus 第六版 第十二章 编程练习

1.不使用全局变量,重写程序清单12.4。#include <stdio.h>void critic(int *);int main(void){ int units=0; printf("How many pounds of a firkin of button?\n"); scanf("%d",&units); while(units!=56) critic(&units); printf("You must have looked it up.\

2022-05-24 11:33:14 268

原创 C Primer Plus 第六版 第十一章 编程练习

1.设计并测试一个函数,从输入中获取n个字符(包括空白、制表符、换行符),把结果储存在 一个数组里,它的地址被传递作为一个参数。#include <stdio.h>void input(char * p, int n){ int i = 0; for (i = 0;i < n;i++) scanf("%c", &p[i]);}//测试函数#define SIZE 10int main(void){ char arr[SIZE]; int i;

2022-05-13 16:34:26 1142 2

原创 C Primer Plus第六版 第十章 编程练习

1.修改程序清单10.7的rain.c程序,用指针进行计算(仍然要声明并初始化数组)。#include <stdio.h>#define MONTHS 12#define YEARS 5int 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,1.6,2.4,0.0,5.2,0.9,0.3,0.9,1

2022-02-16 15:50:15 496

原创 C Primer Plus第六版 第九章 编程练习

1.设计一个函数min(x, y),返回两个double类型值的较小值。在一个简单的驱动程序中测试该函数。double min(double x, double y) { return x < y ? x : y;}#include <stdio.h> //驱动程序int main(void){ double a, b; printf("Enter two double number('q' to quit):\n"); while (scanf_s(

2022-01-09 14:51:21 500

原创 C Primer Plus第六版 第八章 编程练习

1.设计一个程序,统计在读到文件结尾之前读取的字符数。#include <stdio.h>int main(void){int ch;int count=0;while((ch=getchar())!=EOF)count++;printf("The file has %d characters.\n",count);return 0;}2.编写一个程序,在遇到EOF之前,把输入作为字符流读取。程序要打印每个输入的字符及其相应的ASCII十进制值。注意,在ASCII

2021-12-29 21:52:22 337

原创 C Primer Plus 第六版 第七章 编程练习

1.编写一个程序读取输入,读到#字符停止,然后报告读取的空格数、换行符数和所有其他字符的数量。#include <stdio.h>int main(void){char ch;int s_c,n_c,_ch;s_c=n_c=_ch=0;printf("Enter the character for count('#' to quit):\n");while((ch=getchar())!='#'){if(ch==' ') s_c++; /.

2021-12-22 20:33:31 974

原创 C Primer Plus第六版 第六章编程练习10~18

10.编写一个程序,要求用户输入一个上限整数和一个下限整数,计算从上限到下限范围内所有 整数的平方和,并显示计算结果。然后程序继续提示用户输入上限和下限整数,并显示结果,直到 用户输入的上限整数等于或小于下限整数为止。程序的运行示例如下:Enter lower and upper integer limits: 5 9The sums of the squares from 25 to 81 is 255Enter next set of limits: 3 25The sums of th

2021-12-15 14:50:23 1270

原创 C Primer Plus第六版 第六章 编程练习1~9

1.编写一个程序,创建一个包含26个元素的数组,并在其中储存26个小写字母。然后打印数组的 所有内容。#include <stdio.h>#define SIZE 26int main(void){char ch[SIZE];int i;for(i=0;i<SIZE;i++)scanf("%c",&ch[i]);printf('\n');for(i=0;i<SIZE;i++)printf("%c",&ch[i]);return 0;}

2021-12-13 19:51:20 159

原创 C Primer Plus 第五章 编程练习

1.编写一个程序,把用分钟表示的时间转换成用小时和分钟表示的 时间。使用#define或const创建一个表示60的符号常量或const变量。通过while循环让用户重复输入值,直到用户输入小于或等于0的值才停止循环。#include <stdio.h>#define M_PER_H 60int main(void){int min,hour;printf("Please enter the time in minuite,(<=0 quit):\n");scanf(.

2021-12-08 17:15:51 543

原创 C Primer Plus 第四章 编程练习1~8

1.编写一个程序,提示用户输入名和姓,然后以“名,姓”的格式打印出来。#include <stdio.h>int main(void){char fname[40];char lname[40];printf("Please enter your first name:\n");scanf("%s",fname);printf("Please enter your last name:\n");scanf("%s",flname);printf("Your name is

2021-12-06 17:30:57 520 2

原创 C Primer Plus 编程练习第三章2~8

2.编写一个程序,要求提示输入一个ASCII码值(如,66),然后打印输入的字符。#include <stdio.h>int main(void){char ch;printf("Enter the ASCII:");scanf("%d\n",&ch);printf("The character is:%c\n",ch);return 0;}注:char类型也是整数类型 ,所以可以用%d转换说明输入,也可以用%c转换说明显示。3. 编写一个程序,发出一声

2021-12-01 13:34:12 438

原创 C Primer Plus 第三章编程练习一

1.通过试验(即编写带有此类问题的程序)观察系统如何处理整数上溢、浮点 数上溢和浮点数下溢的情况。提示:写完文章后,目录可以自动生成,如何生成可参考右边的帮助文档文章目录系列文章目录 前言 一、pandas是什么? 二、使用步骤 1.引入库 2.读入数据 总结前言提示:这里可以添加本文要记录的大概内容:例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。提示:以下是本篇文章正文内容,下

2021-11-26 20:27:06 736

原创 C Primer plus 第二章练习题

1.编写一个程序,调用一次printf() 函数,把你的名和姓打印在一行。再调用一次printf() 函数, 把你的名和姓分别打印在两行。然后,再调用两次printf() 函数,把你的名和姓打印在一行。 输出应如下所示(当然要把示例的内容换成你的名字):Gustav Mahler←第1次打印的内容Gustav←第2次打印的内容Mahler←仍是第2次打印的内容Gustav Mahler ← 第3次和第4次打印的内容#include <stdio.h>int main(vo

2021-11-22 22:24:54 1118

空空如也

空空如也

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

TA关注的人

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