題目
代碼1:
<code>#include<iostream>using namespace std;int main(){int man, woman;cin>>man>>woman;if(man+woman>=10){if(man>woman){cout</<iostream>/<code>
<code>//代碼2#include<iostream>using namespace std;int main(){int man, woman;cin>>man>>woman;if(man+woman<10){cout<woman){cout</<iostream>/<code>
思路
- 輸入男女人數
- 2層判斷嵌套:第一層是否大於10人;第二層男女人數對比
- 條件輸出
知識點:if語句條件嵌套
閱讀更多 陽光小栗子 的文章