![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
砌玉成璧
这个作者很懒,什么都没留下…
展开
-
C++之函数&引用
#include <iostream>using namespace std;double arrs[] = { 10.1,20.2,30.3,40.4,50.5 };double& setValue(int i) { double& temp = arrs[i]; return temp;}int main() { for (int i = 0; i < 5; i++) { cout << "arrs[" <原创 2021-10-15 21:19:32 · 280 阅读 · 0 评论 -
C++之随机数
直接上代码:#include <iostream> //std#include <iomanip> //setw#include <ctime> //time#include <cstdlib> //srandusing std::setw;using namespace std;int main() { int a[10]; //定义包含10个数的数组 srand((unsigne原创 2021-09-08 22:50:57 · 136 阅读 · 0 评论 -
C++之人机交互
最近在跟着菜鸟教程及bilibili上搜的视频学习C++,也已经看了几天了。突然想到还是把自己的学习过程记录一下吧,这样印象会更深一些,也方便后续查询。main.cpp#include <iostream>#include <string>using namespace std;int main() { int a; string str; cout << "请输入a的值" << endl; cin >>原创 2021-09-07 22:48:54 · 1497 阅读 · 0 评论