* http://wisdom.sakura.ne.jp/programming/cpp/index.html
main.chh
SQL
#include "stdafx.h"
#include
#include "def.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
HUMAN x;
cout<< "height(cm)=";
cin >> x.height;
cout << "weight(kg)=";
cin >> x.weight;
x.calBmi(); // メンバ関数の呼び出し
cout << "bmi=" << class="blsp-spelling-error" id="SPELLING_ERROR_12">bmi << "\n";
if (x.bmi>25.0) {
cout << "too fat" << endl;
} else if (x.bmi > 18.5) {
cout << "normal" << endl;
} else {
cout << "too slim" << endl;
}
return 0;
}
Def.hstruct HUMAN {
**********************************************************************************************
float height;
float weight;
float bmi;
void calBmi();
};
void HUMAN::calBmi() {
bmi = weight/(height*height)*10000.0;
}
SQLの教科書
http://wisdom.sakura.ne.jp/database/sql/index.html