結果
| 問題 | No.8010 Print inside /bin |
| コンテスト | |
| ユーザー |
nola_suz
|
| 提出日時 | 2015-05-03 23:50:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 995 bytes |
| 記録 | |
| コンパイル時間 | 403 ms |
| コンパイル使用メモリ | 60,332 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-07-05 17:56:59 |
| 合計ジャッジ時間 | 751 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
ソースコード
#include <iostream>
#include <fstream>
using namespace std;
int main(){
// char outfile[] = "file.txt"; //読み込むファイルの指定
// ifstream fin( outfile, ios::in | ios::binary );
std::fstream fin("test.bin", std::ios_base::in | std::ios_base::out | std::ios_base::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