将内容输入到文本中、读取文件、将输出结果保存到文件中、计算程序跑的时间(c++)
2020-12-13 15:36
标签:freopen c++ ota tor ons inf ++ alt nbsp 将数据输出到文件中 读取文件中的内容,将输出结果存到文件中 计算程序跑的时间,放在main函数开头和结尾:加头文件ctime 将内容输入到文本中、读取文件、将输出结果保存到文件中、计算程序跑的时间(c++) 标签:freopen c++ ota tor ons inf ++ alt nbsp 原文地址:https://www.cnblogs.com/caijiaming/p/11613076.html#include
freopen("input8.txt", "r",stdin);
freopen("output8.txt", "w", stdout);
int main(){
clock_t start,finish;
double totaltime;
start=clock();
....中间是代码
finish=clock();
totaltime=(double)(finish-start)/CLOCKS_PER_SEC;
cout"此程序的运行时间为""秒!"}
下一篇:c++ 初始化
文章标题:将内容输入到文本中、读取文件、将输出结果保存到文件中、计算程序跑的时间(c++)
文章链接:http://soscw.com/essay/35281.html