#18720: WA(line:3)


gngn15401@gmail.com (冰箱)

學校 : 不指定學校
編號 : 98199
來源 : [123.194.13.42]
最後登入時間 :
2021-08-25 01:43:08

#include <iostream>
using namespace std;
int main(){
int n;
while (cin >>n){
for (int i=0;i<n;i++){
int h1,m1,h2,m2,t;
cin >>h1 >>m1 >>h2 >>m2 >>t;
if (h1==h2){
if (m1+t>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
if (m1+t>60){
int m3=m1+t;
for (m3;m3>=60;m3=m3-60){
h1+=1;
}
if (h1>h2){
cout <<"No" <<endl;
}else if (h1==h2){
if (m3>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
cout <<"Yes" <<endl;
}
}
}
}
}
return 0;
}

 

請問我哪裡有寫錯

#18723: Re:WA(line:3)


rexwu1104@gmail.com (黑雪公主 Black Lotus)

學校 : 新北市私立南山高級中學
編號 : 93041
來源 : [49.216.131.103]
最後登入時間 :
2024-06-06 19:28:43

#include
using namespace std;
int main(){
int n;
while (cin >>n){
for (int i=0;i<n;i++){
int h1,m1,h2,m2,t;
cin >>h1 >>m1 >>h2 >>m2 >>t;
if (h1==h2){
if (m1+t>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
if (m1+t>60){
int m3=m1+t;
for (m3;m3>=60;m3=m3-60){
h1+=1;
}
if (h1>h2){
cout <<"No" <<endl;
}else if (h1==h2){
if (m3>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
cout <<"Yes" <<endl;
}
}
}
}
}
return 0;
}

 

請問我哪裡有寫錯

為什麼不直接乘


#18762: Re:WA(line:3)


gngn15401@gmail.com (冰箱)

學校 : 不指定學校
編號 : 98199
來源 : [123.194.13.42]
最後登入時間 :
2021-08-25 01:43:08

#include
using namespace std;
int main(){
int n;
while (cin >>n){
for (int i=0;i<n;i++){
int h1,m1,h2,m2,t;
cin >>h1 >>m1 >>h2 >>m2 >>t;
if (h1==h2){
if (m1+t>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
if (m1+t>60){
int m3=m1+t;
for (m3;m3>=60;m3=m3-60){
h1+=1;
}
if (h1>h2){
cout <<"No" <<endl;
}else if (h1==h2){
if (m3>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
cout <<"Yes" <<endl;
}
}
}
}
}
return 0;
}

 

請問我哪裡有寫錯

為什麼不直接乘


想說試試其他的ww


#24833: Re:WA(line:3)


andrew99154 (YuCheng)

學校 : 均一國際教育實驗高級中學
編號 : 145338
來源 : [111.254.45.176]
最後登入時間 :
2024-01-03 20:33:30

#include
using namespace std;
int main(){
int n;
while (cin >>n){
for (int i=0;i<n;i++){
int h1,m1,h2,m2,t;
cin >>h1 >>m1 >>h2 >>m2 >>t;
if (h1==h2){
if (m1+t>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
if (m1+t>60){
int m3=m1+t;
for (m3;m3>=60;m3=m3-60){
h1+=1;
}
if (h1>h2){
cout <<"No" <<endl;
}else if (h1==h2){
if (m3>m2){
cout <<"No" <<endl;
}else{
cout <<"Yes" <<endl;
}
}else{
cout <<"Yes" <<endl;
}
}
}
}
}
return 0;
}

 

請問我哪裡有寫錯

為什麼不直接乘


想說試試其他的ww


判斷時用 >=,用>會WA