0分,请问大神哪里错了?

P1425 小鱼的游泳时间

e=(f-e)/60; f=(f-e)%60; 这两句错了
by yexule @ 2017-09-27 20:37:56


不能这样写,不然后面e的值就是错的了
by yexule @ 2017-09-27 20:38:31


e
by 卢本伟牛B @ 2017-09-28 13:50:23


要添加“容器”,如“s” “z”,再交换。(笨一点的方法) ```cpp #include<iostream> using namespace std; int main(){ int a,b,c,d,e,f,s,z; cin>>a>>b>>c>>d; a<=24; b<=60; c<=24; d<=60; e<=24; f<=60; s=(a*60+b*1); z=(c*60+d*1); e=(z-s)/60; f=(z-s)%60; cout<<e<<" "<<f; } ```
by laina_23 @ 2017-09-29 21:09:20


```cpp #include <iostream> using namespace std; int main() {int a,b,c,d,e,f; cin>>a>>b>>c>>d; e=c-a;f=60+d-b; cout<<e<<f; return 0; } ```
by 拾玖 @ 2017-09-30 15:05:50


```cpp #include<bits/stdc++.h> using namespace std; int amin() { int a,b,c,d,cha; cin>>a,b,c,d; cha=(c*60+d)-(a*60+b); cout<<cha/60<<' '; if(cha%60!=0) cout<<cha%60<<endl; return 0; } ```
by Bless_瑶 @ 2017-09-30 19:01:22


```cpp #include <iostream> using namespace std; int main() {int a,b,c,d,e,f; ``` 求大神解答 ```cpp cin>>a>>b>>c>>d; e=c-a; if(d<b) f=60+d-b; else f=d-b; cout<<e<<f; return 0;} ```
by 拾玖 @ 2017-09-30 22:47:53


|