結果

問題 No.8010 Print inside /bin
コンテスト
ユーザー nola_suz
提出日時 2015-05-03 23:48:12
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 879 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 428 ms
コンパイル使用メモリ 73,592 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-27 03:17:22
合計ジャッジ時間 1,032 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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