自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 C++学习之指针数组函数 冒泡排序

指针数组函数利用指针数组函数 结合冒泡排序来对一个数组里面的数进行排序//冒泡排序#include<iostream>using namespace std;void Bibblesort(int* arr, int len)//数组首地址,长度{ for (int i = 0; i < len - 1; i++) { for (int j = 0; j < len - 1 - i; j++) { if (arr[j] > arr[j + 1])

2020-06-18 16:22:09 633

原创 C++学习之一维数组 冒泡排序

冒泡排序#include<iostream>using namespace std;int main(){ //冒泡排序 int arr[9] = { 2,4,7,5,3,6,9,0,1 }; for (int i = 0; i < 8; i++)//总排序数 { for (int j = 0; j < 8 - i; j++)//对比次数 { if (arr[j] > arr[j + 1]) { int temp = arr[j];

2020-06-17 19:57:14 469

原创 C++学习之嵌套循环 打印乘法口诀表

打印乘法口诀表//#include<iostream>using namespace std;int main(){ for (int i = 1; i < 10; i++) { for (int j = 1; j <= i; j++) { cout << j << "*" << i << "=" << i * j << "\t"; } cout << endl;

2020-06-17 16:52:27 293

原创 C++学习之for循环 敲桌子

敲桌子从1开始到100,如果数字中个位或十位含有7,或者是7的倍数,我们打印敲桌子,其他数字直接输出。//敲桌子#include<iostream>using namespace std;int main(){ for (int a = 1; a <= 100; a++) { if (a % 7 == 0 || a % 10 == 7 || a / 10 == 7) { cout << "敲桌子" << endl; } else

2020-06-17 16:06:10 288 1

原创 C++学习 之do...while循环 水仙花数字

水仙花数字水仙花数是指一个三位数,它的每个位上的数字的三次幂之和等于它本身。#include<iostream>using namespace std;int main(){ int x = 100; do { int a, b, c; a= x % 10; //个位 b= x / 10 % 10;//十位 c= x / 100; //百位

2020-06-17 15:47:32 2658

原创 C++学习之while循环 猜数字小游戏

规则介绍系统随机生成一个1~100的数字,玩家输入答案,每次提示过大还是过小,如果五次还没猜出来,则为失败。以下为源代码#include<iostream>using namespace std;#include<ctime>int main(){ srand((unsigned int)time(NULL)); int num = rand() % 100 + 1; int a; int x = 0; while (x < 5) { cin &

2020-06-17 00:10:06 1004

空空如也

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

TA关注的人

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