0
已解决
王俊杰
高级光能
高级光能
https://newcourse.codingtang.com/#/problem/problemSub?id=2686
代码:
- #include<iostream>
- #include<cstdio>
- #include<string>
- #include<algorithm>
- #include<cmath>
- using namespace std;
- struct dm{
- int a,b,c,x,y,z;
- }a1;
- int l,m,n,k,v,k1,k2,v1,v2;
- int main(){
- cin>>a1.a>>a1.b>>a1.c>>a1.x>>a1.y>>a1.z;
- l=a1.a+a1.x;
- m=a1.b+a1.y;
- n=a1.c+a1.z;
- if((a1.c+a1.z)<60){
- v=(a1.c+a1.z)/60;
- m+=v;
- k1=v*60;
- k2=m+k1;
- }
- if((a1.b+a1.z)<60){
- k=(a1.b+a1.z)/60;
- l+=k;
- v1=k*60;
- v2=l+v1;
- }
- cout<<l<<" "<<m<<" "<<n;
- return 0;
- }
- 请大佬找错
0
0
丁博扬
中级天翼
中级天翼
- #include<iostream>
- #include<iostream>
- using namespace std;
- int main(){
- int a,b,c;
- int x,y,z;
- bool flag=0,flga=0;
- cin>>a>>b>>c>>x>>y>>z;
- if(c+z>=60){
- b+=1;
- flag=1;
- }
- if(b+y>=60){
- a+=1;
- flga=1;
- }
- cout<<a+x<<" ";
- if(flag==1){
- cout<<b+y-60<<" ";
- }
- else if(flag==0){
- cout<<b+y<<" ";
- }
- if(flga==0){
- cout<<c+z<<" ";
- }
- else if(flga==1){
- cout<<c+z-60<<" ";
- }
- return 0;
- }
- 75分代码,仅供参考
- ps:这不算整段代码吧
0
0