看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) vc++ 6.0 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): #include "stdafx.h" #include <iostream.h> #include <fstream.h> #include <string.h> #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <time.h> int main(int argc, char* argv[]) { ofstream File1; clock_t t1, t2; File1.open("C:\\File1.xls"); for(int j=0; j<=15 ; j++) { t1 = clock(); Sleep(1000); // t2 = clock(); printf("%lf\n", (t1)/(double)(CLOCKS_PER_SEC)); File1 << (t1)/(double)(CLOCKS_PER_SEC) <<endl; cout << "寫入Data值: "<< (t1)/(double)(CLOCKS_PER_SEC) << "完成!" <<endl; } system("pause"); return 0; } 我有拍圖片 http://ppt.cc/WiR5 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.124.249.111
watson1988:謝謝Billy 搞定了 ^^ 12/11 19:13
watson1988:在後面加個 "\t" 就可以換行了 12/11 19:13
MOONRAKER:這樣寫應該是存csv吧。 12/12 11:32