- UID
- 2175026
- 熱心
- 121 值
- 嘉獎
- 0 次
- 違規
- 0 次
- 在線時間
- 43 小時
- 經驗
- 67 點
- 積分
- 398
- 精華
- 0
- 最後登錄
- 2016-9-22
- 閱讀權限
- 25
- 註冊時間
- 2014-11-4
- 論壇幣
- 57 幣
- 聯合幣
- 115 枚
- 幸運鑽
- 0 顆
- 招待卷
- 0 點
|
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
using namespace std;
#define _ while
#define __ int main()
struct Profile
{
string ID;
bool Sex;
float Height;
float Weight;
float BMI;
};
float GetBMI(float Height,float Weight)
{
float result = Weight / (Height * Height);
return (result);
}
__
{
fstream fileInput;
fileInput.open("data.txt",ios::in);
Profile n[69];
int count = 0;
_((fileInput >> n[count].ID >> n[count].Sex >> n[count].Weight >> n[count].Height))
{
cout << "abcd:" << n[count].ID << n[count].Sex << n[count].Weight << n[count].Height << endl;
count += 1;
}
cout << "\n總共有" << count << "人";
cout << n[68].ID << endl;
system("PAUSE");
return 0;
} |
|