- 229 名前:デフォルトの名無しさん mailto:sage [2008/10/12(日) 03:32:24 ]
- //---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender) { OpenDialog1->Execute(); Fname2 = OpenDialog1->FileName; Edit2->Text = Fname2; } //--------------------------------------------------------------------------- void __fastcall TForm1::Button3Click(TObject *Sender) { OpenDialog1->Execute(); Fname3 = OpenDialog1->FileName; Edit3->Text = Fname3; } //--------------------------------------------------------------------------- void __fastcall TForm1::Button4Click(TObject *Sender) { std::ifstream ifs[3]; ifs[0].open(Fname1.c_str()); ifs[1].open(Fname2.c_str()); ifs[2].open(Fname3.c_str()); for (int i = 0; i < 6; i++) { double sum, t1, t2, t3; ifs[0] >> t1; ifs[1] >> t2; ifs[2] >> t3; sum = (t1 + t2 + t3) / 3; Memo1->Lines->Add(AnsiString(sum)); } }
|

|