結果
| 問題 | No.8010 Print inside /bin |
| コンテスト | |
| ユーザー |
nola_suz
|
| 提出日時 | 2015-05-03 23:48:12 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 879 bytes |
| 記録 | |
| コンパイル時間 | 524 ms |
| コンパイル使用メモリ | 58,840 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-07-05 17:54:44 |
| 合計ジャッジ時間 | 784 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 1 |
ソースコード
#include <iostream>
#include <fstream>
using namespace std;
int main(){
char outfile[] = "file.txt"; //読み込むファイルの指定
ifstream fin( outfile, ios::in | ios::binary );
// ファイルを開く
// ios::in は読み込み専用 ios::binary はバイナリ形式
if (!fin){
cout << "ファイル file.txt が開けません";
return 1;
}
// ファイルが開けなかったときの対策
// double d; //文字列ではないデータ
string s;
while(getline(fin,s)){
cout<<s<<endl;
}
// while(!fin.eof()){ //ファイルの最後まで続ける
// fin.read( ( char * ) &d, sizeof( double ) );
//文字列ではないデータを読みこむ
// cout << d << endl;
// }
fin.close(); //ファイルを閉じる
return 0;
}
nola_suz