20200803给出一 名学生的语文和数学成绩,判断他是否恰好有一门课不及格(<60分),如果是输出1;否则输出0(奥赛一本通 p32 10)

# include<bits/stdc++.h>
using namespace std;
int main()
{  int yy=0,sx=0;

   cout<<"语文成绩:";
   cin>>yy;
   cout<<"数学成绩:";
   cin>>sx;
   if(yy>=60&&sx<60)

     {cout<<1<<endl;

   }

   else

   if(yy<60&&sx>=60)

     {cout<<1<<endl;

   }
   else
     {cout<<0<<endl;}
}

posted @ 2020-08-03 07:59  财盛  阅读(2984)  评论(0编辑  收藏  举报