| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:问: 怎么设置文件读 写??In Reply To:问: 怎么设置文件读 写?? Posted by:wrong123 at 2006-01-05 19:12:42 > 有些题输入太大了,敲错一个就作废了,郁闷
> C ,我知道这么做就可以了:
>
> #ifndef JUDGE
> freopen("D.in", "r", stdin);
> freopen("t.out", "w", stdout);
> #endif
>
> C++的话,怎么设置??有时候感觉用C++输入输出方便,还可能用到STL
> 哪位指点一下。
>
> 谢谢了~~~
应该这样吧:
#include <fstream.h>
void main()
{
ifstream infile("***.txt");
infile>>a>>s;(用法与cin一样)
}
C里的倒还是不懂,这位哥们能否发个样题给我poj邮箱里,谢谢
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator