#include<iostream>using namespace std;int main(){ int a,b; while(cin>>a>>b) { if(a>8&&a<17) cout<<"At School"<<endl; else if(a==7&&b>=30) cout<<"At School"<<endl; else cout<<"Off School"<<endl; } return 0;}
a >= 8
#includeusing namespace std;int main(){ int a,b; while(cin>>a>>b) { if(a>8&&a<17) cout<<"At School"<<endl; else if(a==7&&b>=30) cout<<"At School"<<endl; else cout<<"Off School"<<endl; } return 0;}
輸入 08 00 輸出 Off School發生問題
這樣改就可以了
#include<iostream>
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b)
if(a>7&&a<17)
cout<<"At School"<<endl;
else if(a==7&&b==30)
else cout<<"Off School"<<endl;
}
return 0;