Untitled

 avatar
unknown
plain_text
2 years ago
574 B
4
Indexable
#include <iostream>
using namespace std;

int main()
{
    int n, i = 0, j = 0, c = 0;
    cin >> n;

    if (n >= 60 || n + 1 == 60)
    {
        while (i * 60 <= n)
        {
            i++;
        }
    }
    if (i != 1) i -= 1;
    n = n - i * 60;
    if (n >= 10 || n + 1 == 10)
    {
        while (j * 10 <= n)
        {
            j++;
        }
    }
    if (j != 1) j -= 1;
    n = n - j * 10;
    if (n < 10)
    {
        while (c <= n)
        {
            c++;
        }
    }
    cout << c << " " << j << " " << i;
}
Editor is loading...