結果

問題 No.3010 Print inside /bin
ユーザー nola_suznola_suz
提出日時 2015-05-03 23:50:44
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 995 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 55,472 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-19 05:36:10
合計ジャッジ時間 1,011 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0