摘要: #include <iostream>#include "stdio.h"#include "stdlib.h"#include "cstdlib"//syste()函数需要该头文件; using namespace std; #define OK 1#define ERROR 0#define O 阅读全文
posted @ 2021-11-28 21:07 师大无雨 阅读(918) 评论(0) 推荐(0)
摘要: #include <iostream>#include "stdio.h"#include "stdlib.h"#include "cstdlib"//syste()函数需要该头文件; using namespace std; #define OK 1#define ERROR 0#define O 阅读全文
posted @ 2021-11-28 18:05 师大无雨 阅读(1052) 评论(0) 推荐(0)
摘要: 一、函数指针 先看一个例子: #include<stdio.h> #include<stdlib.h> #include<string.h> #define ERROR 0 #define OK 1 int add(int a,int b){ return a+b; } int multiply(i 阅读全文
posted @ 2021-11-20 22:47 师大无雨 阅读(795) 评论(0) 推荐(1)
摘要: C/C++产生随机数用到两个函数rand() 和 srand()。 一. 不指定范围产生随机数 在C语言中,我们一般使用 <stdlib.h> 头文件中的 rand() 函数来生成随机数,它的用法为: int rand (void); // void 表示不需要传递参数。 C语言中还有一个 rand 阅读全文
posted @ 2021-10-28 09:25 师大无雨 阅读(1050) 评论(0) 推荐(0)