⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stats.c

📁 一遗传算法的例子源程序
💻 C
字号:
#include <time.h>
#include "lithos.h"

int generations;
int evaluated;
int cpuTime;

int startTime;

void readStatistics(FILE *f)
{
	generations = readInt(f);
	evaluated = readInt(f);
	cpuTime = readInt(f);
}

void writeStatistics(FILE *f)
{
	int t = cpuTime + time(0) - startTime;
	writeCommentedInt(f, "Generations", generations);
	writeCommentedInt(f, "Evaluated", evaluated);
	writeCommentedInt(f, "CPU Time", t);
	fputc('[', f);
	writeInt(f, t / 3600);
	writeString(f, " hours]");
	fputc('\n', f);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -