1 solutions

  • 1
    @ 2025-3-22 16:15:08
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	int a=n/3600;
    	int b=n%3600/60;
    	int c=n%3600%60;
    	if(a>=10)
    	{
    		cout<<a<<":";	
    	}
    	else
    	{
    		cout<<"0"<<a<<":";	
    	}
    	if(b>=10)
    	{
    		cout<<b<<":";
    	} 
    	else
    	{
    		cout<<"0"<<b<<":";
    	}
    	if(c>=10)
    	{
    		cout<<c;
    	}
    	else
    	{
    		cout<<"0"<<c;
    	}
    }
    • 1

    Information

    ID
    635
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    1
    Tags
    # Submissions
    55
    Accepted
    28
    Uploaded By