![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c知识
liuze408
这个作者很懒,什么都没留下…
展开
-
c语言生成随机数方法
#include <stdio.h>#include <stdlib.h>#include <time.h> //引用srand()函数需要加<time.h>头文件int main(){ int x; srand(time(NULL)); //使用srand()函数设置随机数种子 x=rand()%10; printf("x=%d\n",x); return 0;}...原创 2022-04-12 15:23:58 · 66 阅读 · 0 评论 -
c语言实现文件的读写操作
#include<stdio.h>#include<stdlib.h>int main(){ //写文件 // FILE *fp=fopen("D:/2023考研/C/test.txt","w");// if(fp==NULL){// printf("打开文件失败!");// exit(0);// }// for(int i=0;i<10;i++){// fputs("Hello file!",fp);// }// fclose(fp); .原创 2022-04-14 11:07:33 · 2323 阅读 · 0 评论