2022年11月10日
摘要:
值传递 值传递要另外开辟一份内存空间,然后把数据传给新的内存空间 地址传递 地址传递不用新开辟一份内存空间,并且指针只占4个字节,节省内存空间
阅读全文
posted @ 2022-11-10 16:50
小凉拖
阅读(22)
推荐(0)
2022年11月9日
摘要:
1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 int temp = 0; 6 int arr[6] = { 0,3,1,7,4,5 }; 7 for (int i = 0; i < 5; i++) { 8 for (in
阅读全文
posted @ 2022-11-09 14:29
小凉拖
阅读(51)
推荐(0)
摘要:
1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 int temp = 0; 6 int arr[6] = { 0,1,2,3,4,5 }; 7 8 for (int i = 0; i <= 6/2-1; i++) { 9
阅读全文
posted @ 2022-11-09 14:13
小凉拖
阅读(27)
推荐(0)
摘要:
循环嵌套内层break只能跳出内层循环 字母数字,键盘上的英文字符用单引号或双引号都能显示出来; 键盘上的中文字符,或用输入法才能打印出来的,比如×,用双引号才能打印出来。 1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5
阅读全文
posted @ 2022-11-09 10:42
小凉拖
阅读(110)
推荐(0)
摘要:
1到100,十位或则个位或则是7的倍数,打印数字和敲桌子 1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 for (int i = 0; i < 100; i++) { 6 int bai = i / 100; 7 int
阅读全文
posted @ 2022-11-09 09:31
小凉拖
阅读(28)
推荐(0)
摘要:
1 #include<iostream> 2 #include<ctime> 3 using namespace std; 4 int main() 5 { 6 for (int i = 100; i < 1000; i++) { 7 int bai = i / 100; 8 int shi = (
阅读全文
posted @ 2022-11-09 09:18
小凉拖
阅读(41)
推荐(0)
2022年11月8日
摘要:
1 #include<iostream> 2 #include<ctime> 3 using namespace std; 4 int main() 5 { 6 srand((unsigned int)time(NULL)); 7 int num=rand() % 100; 8 int i = 1;
阅读全文
posted @ 2022-11-08 15:24
小凉拖
阅读(16)
推荐(0)
摘要:
1 srand((unsigned int)time(NULL)); 2 int num=rand() % 100; srand((unsigned int)time(NULL));为时间戳函数,要使用的时候要加入#include<ctime>头文件
阅读全文
posted @ 2022-11-08 15:12
小凉拖
阅读(46)
推荐(0)
2022年10月26日
摘要:
最近做项目的时候想按照图像的格式将图像的像素值写入文件中方便查看每一点的像素值,可是写入.txt文件发现写入的是这个样子的,有一大片空白: 程序如下: ofstream ofs1; ofs1.open("gray.txt", ios::out); int i = 0; for (int a = 0;
阅读全文
posted @ 2022-10-26 22:29
小凉拖
阅读(266)
推荐(0)
2022年10月3日
posted @ 2022-10-03 19:24
小凉拖
阅读(632)
推荐(0)