Stella981 Stella981
2年前
C++ stat判断路径是文件还是目录
Cstat判断路径是文件还是目录1include<iostream2include<sys/stat.h34usingnamespacestd;56voidfoo(constcharpath){7structst
Wesley13 Wesley13
2年前
2.任务包多线程并行计算
1include<future//进程通信,获取未来的结果2include<iostream3include<thread4include<string5include<chrono//时间6include<mutex//互斥量7
Stella981 Stella981
2年前
OpenGL——折线图柱状图饼图绘制
折线图绘制代码:include<iostream//旧版本固定管线include<Windows.hinclude<GL/glut.h//新版本可编程管线/defineGLEW_STATICinclude<GL/glew.hinclud
Stella981 Stella981
2年前
C++ code:浮点数的比较(Floating
浮点数可以进行比较,但是浮点数由于表示精度在不同浮点数类型中的差异,所以会被误用。例如:1include<iostream2usingnamespacestd;34intmain()5{6floatf17.123456789;7
Stella981 Stella981
2年前
C++练习(coursera北大c++课后习题)
week31描述下面程序输出的结果是:05请填空:1include<iostream2usingnamespacestd;3classA{4public:5intval;6//在此处补充你的代码7};
Stella981 Stella981
2年前
PAT A1015Reversible Primes(可逆素数)
主要考察了判断一个10进制数是否为素数(isZS(intss))和怎么求一个十进制数的n进制数rec(intn,intm)代码:1include<cstdio2include<algorithm3include<iostream4include<string5
Wesley13 Wesley13
2年前
137.CPP自带异常
1include<iostream2include<exception3usingnamespacestd;45//继承自带的异常6classsizeerror:publicexception7{8public:9
Stella981 Stella981
2年前
C++关键字之using的的用法总结
Cusing用法总结1)配合命名空间,对命名空间权限进行管理usingnamespacestd;//释放整个命名空间到当前作用域usingstd::cout;//释放某个变量到当前作用域2)类型重命名作用等同typedef,但是逻辑上更直观。include<iostream
Wesley13 Wesley13
2年前
C++ 注释
C注释程序的注释是解释性语句,您可以在C代码中包含注释,这将提高源代码的可读性。所有的编程语言都允许某种形式的注释。C支持单行注释和多行注释。注释中的所有字符会被C编译器忽略。1include<iostream23/runthisprogramusingthe
Wesley13 Wesley13
2年前
C++ 顺序表 代码实现
线性表存储在计算机中可以采用多种方式,以下是按照顺序存储方式实现:优点:查找很方便缺点:插入元素、删除元素比较麻烦,时间复杂度O(n)1ifndefSeqList_h2defineSeqList_h3include<iostream4usingnamespacestd;