As you see,Give me source.

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/27 22:25:39
As you see,Give me source.

As you see,Give me source.
As you see,Give me source.

As you see,Give me source.
#include
#include
#include "jzcpu.h"
#define TMP_FILE_NAME "tmpcpu123.tmp"
#define DEBUG() (printf("%d\n",__LINE__))
int main()
{
FILE *fd;
int mhz;
char command[300];
printf("CPUOver Clock\n"
"");
fd = fopen("getMhz.sh","w");
fprintf(fd,"#!/bin/bash\n\nMHz=0\n\n"
"if [ %d -gt 420 ] ; then\n"
"\techo \"Advice:You'd better not set CPU's clock,"
" it may shutdown myself or no answer!\"\n"
"\tread -s\n\tclear\n\t"
"echo -e \"please enter a number to set CPU's clock up\"\n\t"
"read -e MHz\n\techo $MHz > %s\n"
"fi\n",cpu_get_clock(),TMP_FILE_NAME);
fclose(fd);
system("bash getMhz.sh");
fd = fopen(TMP_FILE_NAME,"r");
fscanf(fd,"%d",&mhz);
close(fd);
if (mhz != 0)
{
cpu_init();
set_cpu_clock(mhz);
printf("Now,CPU‘s clock is %dMHz\n",cpu_get_clock());
}
sprintf(command,"rm -f getMhz.sh %s",TMP_FILE_NAME);
system(command);
return 0;
}

As you see,Give me source
正如你所见,给我的来源