#include <stdio.h>
#include <time.h>
int main()
{
//代码添加在这里
printf("Time used = %.2f\n", (double)clock() / CLOCKS_PER_SEC);
return 0;
}
windows可以用一下命令输入参数, 避免输入数据的时间影响结果;
echo 参数 | 程序名
如:echo 10 | testCode
#include <stdio.h>
#include <time.h>
int main()
{
//代码添加在这里
printf("Time used = %.2f\n", (double)clock() / CLOCKS_PER_SEC);
return 0;
}
windows可以用一下命令输入参数, 避免输入数据的时间影响结果;
echo 参数 | 程序名
如:echo 10 | testCode