標題:
[隨堂]if...else 輸入舒張壓收縮壓判斷是否正常
[打印本頁]
作者:
陳品肇
時間:
2019-3-30 10:05
標題:
[隨堂]if...else 輸入舒張壓收縮壓判斷是否正常
[attach]6222[/attach]
作者:
李易展
時間:
2019-3-30 11:01
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a,b;
cout<<"請輸入收縮壓:";
cin>>b;
cout<<"請輸入舒張壓:";
cin>>a;
if(b<120 && a<80)
{cout<<"正常!!"<<endl;}
else
{cout<<"不正常!!"<<endl;}
system("pause");
return 0;
}
複製代碼
作者:
謝蓮金
時間:
2019-3-30 11:02
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a,b;
cout<<"請輸入你的舒張壓: ";
cin>>a;
cout<<"請輸入你的收縮壓: ";
cin>>b;
if(a<=80&&b<=120)
{
cout<<"血壓正常"<<endl;
}
else
{
cout<<"血壓不正常"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
洪藜芸
時間:
2019-3-30 11:02
本帖最後由 洪藜芸 於 2019-3-30 11:10 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"請輸入收縮壓:";
cin>>x;
cout<<"請輸入舒張壓:";
cin>>y;
if(x <120 && y <80)
{
cout<<"正常"<<endl;
}
else
{
cout<<"有問題,建議詢問醫生"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
邱楷宸
時間:
2019-3-30 11:03
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a,b;
cout<<"請輸入收縮壓:";
cin>>b;
cout<<"請輸入舒張壓:";
cin>>a;
if(b<=120 && a<=80)
{cout<<"正常!"<<endl;}
else
{cout<<"不正常!"<<endl;}
system("pause");
return 0;
}
複製代碼
作者:
洪子涵
時間:
2019-3-30 11:03
#include<cstdlib>
#include<iostream>
using namespace std;
int main()
{
int sho,shu;
cout<<"請輸入收縮壓=";
cin>>sho;
cout<<"請輸入舒張壓=";
cin>>shu;
if(sho>=120||shu>=80)
{
cout<<"血壓過高"<<endl;
}
else
{
cout<<"血壓正常 "<<endl;
}
system("pause");
return 0 ;
}
複製代碼
作者:
黃傳耀
時間:
2019-3-30 11:06
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int Diastolic,Systolic;
cout<<"請輸入收縮壓:";
cin>>Diastolic;
cout<<"請輸入舒張壓:";
cin>>Systolic;
if(Diastolic<120 && Systolic<80)
{
cout<<"收縮壓:"<<Diastolic<<endl<<"舒張壓:"<<Systolic<<endl<<"血壓正常"<<endl;
}else
{
cout<<"收縮壓:"<<Diastolic<<endl<<"舒張壓:"<<Systolic<<endl<<"血壓不正常"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
王建葦
時間:
2019-4-3 20:46
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"請輸入收縮壓:";
cin>>x;
cout<<"請輸入舒張壓:";
cin>>y;
if(x<=120&&y<=80)
{
cout<<"良好"<<endl;
}
else
{
cout<<"不良好"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
陳宇柏
時間:
2019-5-22 14:49
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
float x,y;
cout<<"請輸入您收縮壓:";
cin>>x;
cout<<"請輸入您舒張壓:";
cin>>y;
if(x<120 && y<80)
cout<<"血壓正常"<<endl;
else
cout<<"血壓偏高"<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2