[表示 : 全て 最新50 1-99 101- 201- 301- 401- 2chのread.cgiへ]
Update time : 05/30 10:49 / Filesize : 157 KB / Number-of Response : 461
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

C/C++の宿題を片付けます 97代目



176 名前:65です [2007/10/25(木) 17:31:19 ]
>169さん
丁寧にありがとうございます。
はい、アメリカの州は50です。
ところで、私は途中まで以下のようにコードを組み立てたのですが、以下のようなやり方でも、プログラムを完成させることはできますか?

#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main (int argc, char **argv)
{
char peek;
ifstream myFile;
string cityName,
stateName;
float gasPrice;
myFile.open("gasprice_file.txt");
while((peek = myFile.peek () ) ! = EOF) {
myFile >> cityName;
myFile >> stateName;
myFile >> gasPrice;
If(! myFile) {
myFile.clear();
cityName = cityName + " " + stateName;
myFile >> sateName;
myFile >> gasPrice;
{
myFile.close();
return 0;
}







[ 続きを読む ] / [ 携帯版 ]

全部読む 前100 次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧]( ´∀`)<157KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef