救救良民吧!!dalao们
查看原帖
救救良民吧!!dalao们
535920
zcy0826楼主2024/8/19 11:45
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int h,m,s;
	int a=0,f=0,k=0;
	int e;
	cin>>h>>m>>s>>e;
	for(int i=1;i<=e;i++)
	{
		for(int j=1;j<=i;j++)
		{
			s++;
			if(s==60)
			{
				s=0;
				m+=1;
			}
			else if(m==60)
			{
				m=0;
				h+=1;
			}
		}
	}
	a=h;
	f=m;
	k=s;
	cout<<a<<" "<<f<<" "<<k;
    return 0;
} 
2024/8/19 11:45
加载中...