Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MainClass {
- static void wieksze(){
- TimeSpan tod = DateTime.Now.TimeOfDay;
- int nowMins = (int)tod.TotalMinutes;
- string [] hs = new string[]{"21:24","14:25","13:67","23:24"};
- for(int i =0;i<hs.Length;i++){
- string h = hs[i];
- // Console.WriteLine(h.Substring(0,2));
- // Console.WriteLine(h.Substring(3,2));
- int godzina = Convert.ToInt32(h.Substring(0,2));
- int minuta = Convert.ToInt32(h.Substring(3,2));
- int lateMins = godzina * 60 + minuta;
- if (nowMins >= lateMins)
- {
- Console.WriteLine("LATE");
- }
- else
- {
- Console.WriteLine("ON TIME");
- }
- }
- }
- public static void Main (string[] args) {
- Console.WriteLine ("Hello World");
- wieksze();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement