自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 51单片机学习2

让开发板的矩阵键盘显示1,2,3等数字并在LCD屏中显示。模块化,LCD屏的调用代码可以下载后直接调用以下位矩阵子函数代码#include #include "Delay.h"unsigned char MatrixKey(){ unsigned char KeyNumber=0; P1=0xFF; #注:P1=0xFF表示I/O都为高电频无法输出电流 P1_3=0; #注:P1_3=0表示1_3口为低电频可以输出电流进行调用 if(P1_...

2022-06-18 23:06:46 107 1

原创 51单片机学习1

数码管消影位选 段选 清零 位选 段选 清零 位选 段选 清零;51单片机数码管显示#include void Nixie(unsigned char Location,Number);void Delay(unsigned int xms);unsigned char x[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71,0x00};#注:16进制数组,用来表示P0 L口...

2022-06-15 23:35:19 441

原创 自学C第19天

C Primer Plus第11章复习题5:#includechar* pr(char* str); #注:pr表示一个指向str的指针,str也是一个指针,所以pr是指针的指针。int main(void){ char* x; x = pr("Ho Ho Ho!"); return 0;}char* pr(char* str) { char* pc; pc = str; while (*pc) ...

2022-06-07 23:11:25 88

原创 自学C第18天

C primer plus第10章第13题:#include void get_arr(double ar[][5]);void get_aver(double ar[][5]);void get_avet(double ar[][5]);void get_max(double ar[][5]);int main(void) { double list[3][5]; get_arr(list); get_aver(list); get_ave...

2022-06-07 23:09:38 57

原创 自学C第17天

C primer plus第10章第11题:#include #define COLS 5void p_arr(double ar[][5],double cr[][5],int x);void d_arr(double ar[][5],double cr[][5],int y);int main(void) { double target1[3][5]; double target2[3][5]; double source[3][5] = { {3....

2022-06-02 23:28:11 34

原创 自学C第16天

C primer plus第10章第1题:#include#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.4,7.3},

2022-06-01 22:02:48 52

原创 自学C第15天

C Primer Plus第9章第8题:#include <stdio.h>void power(double a, int b);int main(void){ double x; int y; printf("Please enter two numbers:"); while (scanf("%lf %d",&x,&y) == 2) { po...

2022-05-28 20:13:35 36

原创 自学C第14天

C primer plus第九章第1题:#include <stdio.h>double min(double u, double v);int main(void){double m;double x = 5, y = 2;m = min(x, y);printf("%g", m);return 0;}double min(double u, double v)...

2022-05-27 21:59:11 37

原创 自学C第13天

C primer plus第9章:递归......有点难理解,尾递归还好,常规的递归真的很难理解。#include <stdio.h>void up_and_down(int);int main(void){ up_and_down(1); return 0; }void up_and_down(int n){ printf("Level %d: n location %p\n",n,&n); ...

2022-05-24 22:34:03 58

原创 自学C第12天

C primer plus第8章第5题:#include<stdio.h>int main(void){int number;int high =100, low =0;int guess = (high + low) / 2; #注:中位数等于大数加小数除以2char answer;printf("Please put a integer from 0 to 100\n");...

2022-05-23 22:33:49 48

原创 自学C第11天

C primer plus第8章第1题:#include <stdio.h>int main(void){int ch;int i = 0;while ((ch = getchar()) != EOF){putchar(ch);++i;}printf("The total input o...

2022-05-22 22:30:18 86

原创 自学C第10天

#define BEET 1.15#define CARR 1.09void show_menus(void);float pack_fee(float a, float b, float c); #注:如果要定义函数并且需要用到函数的返回值,前面一定要声明数据类型,如果不 声明会默认返回整数型。float total_p(float a, float b, float c);float discount(float a, float b, float c);int main(voi

2022-05-18 20:50:15 122

原创 自学C第9天

C primer plus第7章,第4题#include <stdio.h>int main(void){char ch;int i = 0;while ((ch = getchar()) != '#'){if (ch == '.'){putchar('!');i++;}else if (ch == '!'){putchar('!');putchar('!');i++;}elseputchar(ch);}

2022-05-17 21:34:18 77

原创 自学C第8天

C primer plus第7章第一题:#include <stdio.h>#include <ctype.h>int main(void){char ch;int c_w = 0;int c_s = 0;int c_n = 0;int c_o = 0;while ((ch = getchar()) != '#') #注:ch = getchar()一定要用括号括起来 因为!=的运算符优先级最高{if (islower(ch

2022-05-16 23:06:06 48

原创 自学C第7天

第12题:#include <stdio.h>int main(void){int a;double b;int n;while (printf("Please enter how many times you want to try:"), scanf("%d", &n) == 1){b = 0.0;for (a = 1.0; a <= n; a++)b += 1.0 / a;printf("After %d tries the r

2022-05-15 20:10:10 49

原创 自学C第6天

C Primer Plus 第6章第3题:#include <stdio.h>int main(void){char ch;int row, b;for (row = 1; row <= 6; row++){for (ch = 'F', b = 1; b <= row; b++, ch--)printf("%c", ch);printf("\n");}return 0;}第4题:#include <stdio.h&

2022-05-13 22:24:45 54

原创 自学C第5天

C primer plus 第5章第6题#include <stdio.h>int main(void){int earn, days, working, sum;working = 0;earn = 0;sum = 0;printf("Please enter your working days: ");scanf("%d", &days);while (working < days){working = working++;

2022-05-12 22:06:52 37

原创 自学C第四天

C primer plus第5章第一题#include#define h_m 60;int main(void){int mins, hours, l_mins;printf("Please enter the number of mintues(enter 0 to quit): ");scanf("%d", &mins); #注:非数组&号一定不能漏掉,不然会报错,没有初始化minswhile (mins > 0) {hours = mins

2022-05-11 22:33:46 177

原创 自学C第三天

C primer plus,4.8章节第5题卡住了#includeint main(void){float speed;float size;printf("Please enter the download speed of your internt: ");scanf("%.2f", &speed);printf("Please enter the file size you want to download: ");scanf("%.2f", &si

2022-05-10 22:19:51 47

原创 自学C第二天

scanf 报错1.运行报错严重性 代码 说明 项目 文件 行 禁止显示状态错误:C4996 ‘scanf’: This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.解决方法:还有其他方法(来自网络)方法2:在程序最前面加,#pragma

2022-05-09 21:58:17 62 1

空空如也

空空如也

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

TA关注的人

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