Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <algorithm>
- int mas[100];
- using namespace std;
- int main() {
- int w, j, m, a, b, c, n;
- freopen("INPUT.TXT", "r", stdin);
- freopen("OUTPUT.TXT", "w", stdout);
- scanf("%d\n", &n);
- for (int i = 0; i < n; i++) {
- scanf ("%d %d %d", &a, &b, &c);
- mas[i] = 3600 * a + 60 * b + c;
- }
- sort(mas, mas + n);
- for (int f = 0; f < n; f++) {
- int r = mas[f] / 3600;
- int t = (mas[f] - ((mas[f] / 3600) * 3600)) / 60;
- int y = mas[f] - ((mas[f] / 3600) * 3600) - (((mas[f] - ((mas[f] / 3600) * 3600)) / 60) * 60);
- printf("%d %d %d\n", r, t, y);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement