當前位置:編程學習大全網 - 網站源碼 - 在c++中如何使用difftime?

在c++中如何使用difftime?

妳的那些unknown character '0xa1' 的錯誤就是因為字符是全角字符

即中文輸入法下輸入的

可能妳輸入時用的是中文輸入法

或者是從別處拷貝來的代碼

c++不能用clrscr,delay

#include <time.h>

#include <stdio.h>

#include <dos.h>

#include <conio.h>

#include <windows.h>

int main(void)

{

time_t first, second;

//clrscr();

system("cls");

first = time(NULL);

//delay(2000);

Sleep(2000);

second = time(NULL);

printf("The difference is: %f seconds\n",difftime(second,first));

getch();

return 0;

}

  • 上一篇:WIN7和XP雙系統啟動項找不到win7
  • 下一篇:我的ipad2剛剛越獄,現在我想下載“鱷魚小頑皮愛洗澡”這個遊戲怎麽下?
  • copyright 2024編程學習大全網