Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:问: 怎么设置文件读 写??

Posted by shiming413 at 2006-01-05 20:02:56
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator