Advertisement
lvm9

Untitled

Oct 11th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7. float estatura[10], peso[10];
  8. double imc;
  9. int a,paciente[10], estado;
  10.  
  11. a=0;
  12. do
  13. {
  14. cout <<"Paciente #"<<(a+1)<<endl;
  15. cout <<"Ingresa el numero del paciente (4 digitos)" <<endl;
  16. cin >>paciente[a];
  17. cout <<"Ingresa la estatura del paciente" <<endl;
  18. cin >>estatura[a];
  19. cout <<"Ingresa el peso del paciente" <<endl;
  20. cin >>peso[a];
  21. a=a+1;
  22.  
  23. }while(a<10);
  24.  
  25.  
  26. cout <<setw(8)<<"Paciente"<<setw(12)<<"Estatura"<<setw(7)<<"Peso"<<setw(8)<<"IMC"<<setw(20)<<"Se muestra\n";
  27.  
  28. a=0;
  29. do
  30. {
  31. imc = (peso[a]/(estatura[a]*estatura[a]));
  32. if(imc > 25)
  33. {
  34.  
  35. }
  36. cout<< setw(4)<<paciente[a]<<setw(12)<<estatura[a]<<setw(11)<<peso[a]<<setw(12)<<imc<<setw(9)<<"Sobrepeso"<<endl;
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. a=a+1;
  48. }while(a<10);
  49.  
  50.  
  51.  
  52.  
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement