Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- float estatura[10], peso[10];
- double imc;
- int a,paciente[10], estado;
- a=0;
- do
- {
- cout <<"Paciente #"<<(a+1)<<endl;
- cout <<"Ingresa el numero del paciente (4 digitos)" <<endl;
- cin >>paciente[a];
- cout <<"Ingresa la estatura del paciente" <<endl;
- cin >>estatura[a];
- cout <<"Ingresa el peso del paciente" <<endl;
- cin >>peso[a];
- a=a+1;
- }while(a<10);
- cout <<setw(8)<<"Paciente"<<setw(12)<<"Estatura"<<setw(7)<<"Peso"<<setw(8)<<"IMC"<<setw(20)<<"Se muestra\n";
- a=0;
- do
- {
- imc = (peso[a]/(estatura[a]*estatura[a]));
- if(imc < 23)
- {
- cout<< setw(4)<<paciente[a]<<setw(12)<<estatura[a]<<setw(11)<<peso[a]<<setw(12)<<imc<<setw(15)<<"Desnutricion"<<endl;
- }
- if(imc >= 23)
- {
- if(imc <=25)
- {
- cout<< setw(4)<<paciente[a]<<setw(12)<<estatura[a]<<setw(11)<<peso[a]<<setw(12)<<imc<<setw(15)<<"Normal"<<endl;
- }
- }
- if(imc > 25)
- {
- cout<< setw(4)<<paciente[a]<<setw(12)<<estatura[a]<<setw(11)<<peso[a]<<setw(12)<<imc<<setw(15)<<"Sobrepeso"<<endl;
- }
- a=a+1;
- }while(a<10);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement