- 博客(4)
- 收藏
- 关注
原创 文件输入输出(非重定向)
<br />#include "stdafx.h" #include<iostream> #include<math.h> #include<string> #include<time.h> using namespace std; #define INF 1000000000 int _tmain(int argc, _TCHAR* argv[]) { FILE *fin, *fout; fin = fopen("data.in", "rb"); fout = fopen
2010-11-12 22:25:00
259
原创 重定向文件
<br />#include "stdafx.h" #include<iostream> #include<math.h> #include<string> #include<time.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); /* 程序文件 */
2010-11-12 22:10:00
230
原创 例题2-4 输入未知有几个数据
关键是:问题问的是未知有多少数据,所以测试时不好进行显示,因为enter键并不表示所有数据输入结束!所以只能采用以下办法:按"enter" + "Ctr+z" + "enter"即可以前在做HDOJ等题时用while(cin>>)是因为其为多组数据才这样的,即不知道有几组数据,而不是不知道每组数据有几个值!!!当然,好像有道题是不知道每组数据有几个值的,但是一时找不到了。。。#include "stdafx.h" #include #include #include #includ
2010-11-12 21:45:00
404
原创 测试时间
<br />#include "stdafx.h" #include<iostream> #include<math.h> #include<string> #include<time.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { double t1=clock(); /* */ double t2=clock(); printf("Time Used = %.2lf/n",(t
2010-11-12 20:23:00
395
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人