啊哈磊_编程从这里起步

标题: ??? [打印本页]

作者: zyx6680599    时间: 2018-3-5 11:14
标题: ???
本帖最后由 zyx6680599 于 2018-3-5 21:01 编辑

在啊哈C里就能运行 在DEV C++里就说'clock' was not declared in this scope就是“s=clock();那行错误
#include <stdio.h>
#include <stdlib.h>

int main()
{
     int a;
         int s = 0;
         int b;

         for(a = 0;a < 2000000000;a++)
         {

     }
        s = clock();
        printf("%ums\n",s);
        s = clock();
        for(b = 0;b < 2000000000;b++)
        {

    }
       printf("%ums",clock() - s);
    system("@pause > nul");
    return 0;
}


作者: 创世菌    时间: 2018-3-5 11:14
加上
[mw_shl_code=c,false]#include <time.h>[/mw_shl_code]
就行了!




欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/) Powered by Discuz! X3.2