![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++_项目七
日常笔记
坑货的成长史
个性也是一种生活态度!
展开
-
项目练习
#include <iostream>#include <fstream> #include <string> #include <windows.h>#include <stdlib.h>using namespace std;#define N 64//假定谷点是一个比邻接点海拔都要低的点。编写一个名为 isValley 的 函数供你的程序调用 。bool isValley(const double geid[N][N],.原创 2020-11-06 01:20:58 · 67 阅读 · 0 评论 -
防御式编程
#include <assert.h> //断言头文件#include <iostream>#include <Windows.h>using namespace std;int main(void){ int lose; int a=0; cout << "请输入加到一百的数字:"; cin >> lose; assert(lose<100); for(int i=lose; i<=100; ++i){.原创 2020-11-06 01:12:46 · 73 阅读 · 0 评论 -
打印杨辉三角形
#include <iostream>#include <Windows.h>#include <iomanip>using namespace std;#define N 15int main(void){ int yanghui[N][N]={0}; //数组元素清零 /** for(int i=0; i<N; ++i){ yanghui[i][0]=1; yanghui[i][i]=1; } **/ for(int i.原创 2020-11-06 01:03:09 · 93 阅读 · 0 评论 -
项目实现
#include <iostream>#include <fstream> #include <string> #include <windows.h>#include <stdlib.h>using namespace std;#define N 64 //判断峰点bool isPeak(const double grid[N][N], int i, int j);int main(void){ int nrows,.原创 2020-11-06 00:54:53 · 244 阅读 · 0 评论 -
项目精讲-常见错误总结
原创 2020-11-06 00:41:06 · 63 阅读 · 0 评论 -
二维数组作为函数参数
#include <iostream>#include <Windows.h>//版本一 省略函数//二维数组省略一个高维函数 但低维位函数必须定义void printf1(int a1[][3]){ for(int i=0; i<3; ++i){ for(int j=0; j<3; ++j){ printf("%d\t", a1[i...原创 2020-04-03 18:18:43 · 2404 阅读 · 0 评论 -
更高维度--多维数组
#include <iostream>#include <Windows.h>#include <stdio.h>#include <stdlib.h>int main(void) { int i, j, k=0; int array1[3][3][3]={ //三维数组的定义 {{1, 2, 3}, {4, 5, 6}...原创 2020-04-03 18:13:28 · 149 阅读 · 0 评论 -
二维数组的存储方式
#include <stdio.h>#include <stdlib.h>#include <iostream>using namespace std;int main(void) { int i=0; int j=0; //赋值 int array1[3][4]= { {1, 2, 3, 4}, {5, 6, 7, 8},...原创 2020-04-01 14:20:31 · 2446 阅读 · 0 评论 -
二维数组的访问
#include <iostream>#include <Windows.h>using namespace std;//int array1[3][4]; //全局变量会初始化为零int main(void) { //int i=0,j=0; 初始化为零 //int array1[3][4]; 局部变量 元素值不确定 int array1[3...原创 2020-03-31 15:04:45 · 480 阅读 · 0 评论 -
二维数组的定义与初始化
#include <iostream>#include <Windows.h>#include <stdio.h>int main(void) { int i; int j; //二维数组的定义 //和数组一样 需要先定义再使用 int a1[5]; //一行女兵 //实例: int a2[3][3]; //三行女兵 //定义了一个二...原创 2020-03-30 17:11:41 · 2259 阅读 · 0 评论