自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Irene's Blog

自学经历 欢迎指正

  • 博客(18)
  • 收藏
  • 关注

原创 《C++ Primer Plus》(第6版)编程练习——第2章

第1题(略)第2题#include <iostream>int main(){ using namespace std; int lon; cout << "Enter a length in long: "; cin >> lon; int yar; yar = 220 * lon; cout << lon <&...

2019-12-30 17:42:50 172

原创 《C Primer Plus》(第6版)编程练习——第14章

第1题#include <stdio.h>#include <string.h>#include <ctype.h>int days(char* st);struct month { char name[10]; char abbrev[4]; int days; int monumb;};const struct month mont...

2019-12-28 20:44:20 177

原创 《C Primer Plus》(第6版)编程练习——第13章

第1题

2019-12-16 10:42:32 197

原创 《C Primer Plus》(第6版)编程练习——第12章

第1题#include <stdio.h>void critic(int* u);int main(void){ int units; printf("How many pounds to a firkin of butter?\n"); scanf("%d", &units); while (units != 56) critic(&units)...

2019-12-05 21:09:04 171

原创 《C Primer Plus》(第6版)编程练习——第11章

第1题#include <stdio.h>#define LEN 10char* getnchar(char* str, int n);int main(void){ char input[LEN]; char* check; check = getnchar(input, LEN - 1); if (check == NULL) puts("Input fa...

2019-11-16 18:45:38 251

原创 Visual Studio中无法使用某些I/O函数的解决方法

例如:printf、scanf、gets等函数会报错解决方法:项目>>属性>>C/C++>>预处理器>>预处理定义>>编辑>>添加“_CRT_SECURE_NO_WARNINGS”

2019-11-10 14:48:27 407

原创 《C Primer Plus》(第6版)编程练习——第7章

第1题#include <stdio.h>int main(void){ char ch; int sp_ct = 0; int nl_ct = 0; int other = 0; while ((ch = getchar()) != '#') { if (ch == ' ') sp_ct++; else if (ch == '\n') nl_c...

2019-11-10 11:04:47 230

原创 运算符优先级

2019-11-08 22:46:01 81

原创 《C Primer Plus》(第6版)编程练习——第6章

第1题#include <stdio.h>#define SIZE 26int main(void){ char lcase[SIZE]; int i; for (i = 0; i < SIZE; i++) lcase[i] = 'a' + i; for (i = 0; i < SIZE; i++) printf("%c", lcase[i]);...

2019-11-07 21:56:14 140

原创 《C Primer Plus》(第6版)编程练习——第10章

第1题#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....

2019-11-07 19:35:48 151

原创 《C Primer Plus》(第6版)编程练习——第5章

第1题#include <stdio.h>int main(void){ const int minperhour = 60; int minutes, hours, mins; printf("Enter the number of minutes to convert: "); scanf("%d", &minutes); while (minutes &...

2019-11-06 18:30:01 145

原创 《C Primer Plus》(第6版)编程练习——第4章

第1题#include <stdio.h>int main(void){ char fname[40]; char lname[40]; printf("Enter your first name: "); scanf("%s", fname); printf("Enter your last name: "); scanf("%s", lname); prin...

2019-11-04 14:39:05 119

原创 《C Primer Plus》(第6版)编程练习——第3章

第2题#include <stdio.h>int main(void){ int ascii; printf("Enter an ASCII code: "); scanf("%d", &ascii); printf("%d is the ASCII code for %c.\n", ascii, ascii); return 0;}第3题#inc...

2019-11-02 14:50:16 164

原创 《C Primer Plus》(第6版)编程练习——第2章

第1题#include <stdio.h>int main(void){ printf("Gustav Mahler\n"); printf("Gustav\nMahler\n"); printf("Gustav "); printf("Mahler\n"); return 0;}第2题#include <stdio.h>int main(vo...

2019-11-01 13:53:25 142

原创 《C Primer Plus》(第6版)编程练习——第9章

第1题#include<stdio.h>double min(double, double);int main(void){ double x, y; printf("Enter two numbers (q to quit):\n"); while (scanf("%lf%lf", &x, &y) == 2) { printf("The smal...

2019-10-29 21:47:13 198

原创 printf()和scanf()

printf()函数转换说明及其打印的输出结果转换说明输出%a浮点数、十六进制数和p记数法(C99/C11)%A浮点数、十六进制数和p记数法(C99/C11)%c单个字符%d有符号十进制整数%e浮点数,e记数法%E浮点数,e记数法%f浮点数,十进制记数法%g根据值的不同,自动选择%f或%e。%e格式用于指数小于-4或...

2019-10-26 19:46:19 225

原创 ASCII字符代码表

2019-10-26 16:24:19 1508

原创 《C Primer Plus》(第6版)编程练习——第8章

《C Primer Plus》(第6版)编程练习——第8章(部分)第4题#include<stdio.h>#include<ctype.h>#include<stdbool.h>int main(void){ int c; int words = 0; int ct = 0; //每个单词的字符数 int sum_ct ...

2019-10-26 10:38:30 223

空空如也

空空如也

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

TA关注的人

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