Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. struct clipa
  5. {
  6. int sec,mi,ora;
  7. };
  8. void timp(clipa c)
  9. {
  10. if(c.ora<10)
  11. cout<<0<<c.ora<<":";
  12. else cout<<c.ora<<":";
  13. if(c.mi<10)
  14. cout<<0<<c.mi<<":";
  15. else cout<<c.mi<<":";
  16. if(c.sec<10)
  17. cout<<0<<c.sec<<":";
  18. else cout<<c.sec<<":";
  19. }
  20. ifstream f("clipa.in");
  21. int main()
  22. {int n,minut,secunda,ora;
  23. clipa x,tp;
  24. tp.ora=tp.mi=tp.sec=0;
  25. f>>n;
  26. while(n)
  27. {
  28. f>>x.sec>>x.mi>>x.ora;
  29. timp(x);
  30. cout<<endl;
  31.  
  32. n--;
  33. }
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement