Advertisement
Malinovsky239

Untitled

Oct 19th, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <cstdio>
  2. #include <algorithm>
  3.  
  4. int mas[100];
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.     int w, j, m, a, b, c, n;
  10.     freopen("INPUT.TXT", "r", stdin);
  11.     freopen("OUTPUT.TXT", "w", stdout);
  12.     scanf("%d\n", &n);
  13.     for (int i = 0; i < n; i++) {
  14.         scanf ("%d %d %d", &a, &b, &c);
  15.         mas[i] = 3600 * a + 60 * b + c;
  16.     }
  17.     sort(mas, mas + n);
  18.     for (int f = 0; f < n; f++) {
  19.         int r = mas[f] / 3600;      
  20.         int t = (mas[f] - ((mas[f] / 3600) * 3600)) / 60;
  21.         int y = mas[f] - ((mas[f] / 3600) * 3600) - (((mas[f] - ((mas[f] / 3600) * 3600)) / 60) * 60);  
  22.         printf("%d %d %d\n", r, t, y);
  23.     }
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement