自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 问答 (1)
  • 收藏
  • 关注

原创 队列_C++ 面向对象

#include<iostream>using namespace std;#define MAXSIZE 6class Queue{public: Queue() { front = 0; rear = 0; } void EnQueue(int num) { if ((rear+1)%MAXSIZE==front) { cout << "队列已满!" << endl; } data[rear] = num; r

2021-09-17 22:34:13 87

原创 队列_C语言

#include <iostream>#define MAXSIZE 6using namespace std;struct Queue{ int data[MAXSIZE]; int front; int rear;};void InitQueue(Queue* q){ q->front = 0; q->rear = 0;}void EnQueue(int num, Queue* q){ if ((q-&gt

2021-09-17 22:32:51 70

原创 2021-09-12

#include<iostream>#include<easyx.h>#include<conio.h>using namespace std;int high, width;int x, y;int bullet_x, bullet_y;/*初始化 飞机、子弹、界面的参数’*/void init_start(){ /*这里不能加int类型名 否则相当于重新声明 在函数里重新声明了 函数结束后 就会被释放 全局变量也一样 */ int hi

2021-09-12 13:45:06 49

原创 2020-12-13

疑难问题(8.8)时间:2020/12/12运行程序:VS2019#include<stdio.h>int main(){ int i=0, j=0, k=0, l=0, m=0, n=0; char str[20]; printf("请输入文字:\n"); scanf_s("%s",str,sizeof(str)); while ((str[i] != '\n')&&(i<=20)) { if ((str[i] >= 'A') &

2020-12-13 18:26:30 61

原创 疑难问题(习题8.4)

疑难问题(习题8.4)时间:2020/11/25运行软件:VS2019代码如下:#include <stdio.h>int a[20], * p = a;void move(int a[20],int n,int m){ int i; for (i = 0; i < n; i++) { if ((i+m)<=n-1) { *(p + i + m) = *(p + i); } else { *(p + i + m - n) = *(p

2020-11-25 22:07:51 93

原创 C程序設計課後習題8.3

C程序設計課後習題8.3時間:2020/11/25運行軟件:VS2019習題内容:輸入十個整數,將其中di最小的數與第一个数对换,把最大的数与最后一个数对换。写三个函数:1.输入10个数2.进行处理3.输出10个数代码如下:#include <stdio.h>int a[10];void input(void){ int i; printf("enter 10 numbers:\n"); for (i = 0; i < 10; i++) scanf_s("

2020-11-25 14:11:31 104

原创 scanf_s的键入

scanf_s的键入时间:2020/11/25运行软件:VS2019#include <stdio.h>int main(){ int a, b; printf("请输入两个数:\n"); scanf_s("%d,%d", &a, &b); printf("%d,%d\n",a,b); return 0;}运行时当输入的是中文模式下的逗号时结果如图:解决方法:输入时使用英文原因:中文输入法输入的符号无法被识别结果如图:...

2020-11-25 13:38:37 172

原创 疑难问题 2020-11-24

疑难问题时间:2020/11/24运行软件:VS2019#include <stdio.h>void z(char str[]){ static int j, k, l, m; for (int i = 0; i < 80; i++) { if (str[i] >= '0' && str[i] <= '9') j++; else if ((str[i] >= 'a' && str[i] <= 'z')

2020-11-24 14:49:36 67

原创 疑难解决 2020-11-23

疑难解决时间:2020/11/23运行软件:VS2019#include <stdio.h>void T(int a[3][3]){ int i, j, t; for (i = 0; i < 3; i++) for (j = i + 1; j < 3; j++) { t = a[i][j]; a[i][j] = a[j][i]; a[j][i] = t; }}int main(){ int a[3][3] = { {1,2,3},{4

2020-11-23 21:45:03 105

原创 Return 在函数中的作用 2020-11-21

Return 在函数中的作用时间:2020/11/21运行软件:VS2019#include <stdio.h>void af(void){ int i; for (i = 0; i < 5; i++) { printf("啊啊啊\n"); return; } printf("啦啦啦\n");}int main(){ af(); return 0;}运行结果如图:说明return在函数中的作用是终止函数...

2020-11-21 21:45:06 152

原创 数组越界

疑难问题时间:2020/11/21运行软件:VS2019#include <stdio.h>int main(){ int a[3][3] = { {1,2,3},{4,5,6},{7,8,9} }; int i, j; void T(int a[][3]); printf("原数组为:\n"); for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { printf("%d,", a[i][j]);

2020-11-21 21:06:42 89

空空如也

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

TA关注的人

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