Guest User

Untitled

a guest
Jan 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication9
  7. {
  8. class Program
  9. {
  10. static int Main(string[] args)
  11. {
  12.  
  13. string vstup;
  14. Console.WriteLine("zadejte sekundy");
  15. vstup = Console.ReadLine();
  16. int sekundy;
  17. if (int.TryParse(vstup, out sekundy) != true)
  18. {
  19. return 1;
  20. }
  21.  
  22. int hodiny, minuty;
  23. minuty = sekundy / 60;
  24. hodiny = minuty / 60;
  25. sekundy = sekundy - (minuty * 60);
  26. minuty = minuty - (hodiny * 60);
  27. Console.WriteLine("{0}h : {1}m : {2}s", hodiny, minuty, sekundy);
  28. Console.ReadLine();
  29. return 0;
  30.  
  31. }
  32. }
  33. }
Add Comment
Please, Sign In to add comment