Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ZivkovicDj05122019_2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i, n, h, s, d, j;
- Console.WriteLine("Unesite broj: ");
- n = int.Parse(Console.ReadLine());
- j = n % 10;
- d = (n % 100) / 10;
- s = (n % 1000) / 100;
- h = n / 1000;
- if ((h % 2) == 0)
- n = n % 1000;
- if ((s % 2) == 0)
- n = (n / 1000 * 100 + n % 100);
- if ((d % 2) == 0)
- n = (n / 100 * 10 + n % 10);
- if ((j % 2) == 0)
- n = n / 10;
- Console.WriteLine("Uneti broj {0}.", n);
- Console.ReadLine();
- }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ZivkovicDj05122019_3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int h1,h2,h3,m1,m2,m3,s1,s2,s3,prvi,poslednji,ch,cm,cs;
- Console.WriteLine("Unesite vreme dolaska Marka (sati): ");
- h1 = Int32.Parse(Console.ReadLine());
- Console.WriteLine("Unesite vreme dolaska Marka (minuti): ");
- m1 = Int32.Parse(Console.ReadLine());
- Console.WriteLine("Unesite vreme dolaska Janka (sati): ");
- h2 = Int32.Parse(Console.ReadLine());
- Console.WriteLine("Unesite vreme dolaska Janka (minuti): ");
- m2 = Int32.Parse(Console.ReadLine());
- Console.WriteLine("Unesite vreme dolaska Petra (sati): ");
- h3 = Int32.Parse(Console.ReadLine());
- Console.WriteLine("Unesite vreme dolaska Petra (minuti): ");
- m3 = Int32.Parse(Console.ReadLine());
- s1 = h1 * 3600 + m1 * 60;
- s2 = h2 * 3600 + m2 * 60;
- s3 = h3 * 3600 + m3 * 60;
- if (s1 < s2 && s1 < s3)
- {
- prvi = s1;
- }
- else if (s2 < s1 && s2 < s3)
- {
- prvi = s2;
- }
- else
- {
- prvi = s3;
- }
- if (s1 > s2 && s1 > s3)
- {
- poslednji = s1;
- }
- else if (s2 > s1 && s2 > s3)
- {
- poslednji = s2;
- }
- else
- {
- poslednji = s3;
- }
- cs = poslednji - prvi;
- ch = cs / 3600;
- cs -= ch * 3600;
- cm = cs / 60;
- Console.WriteLine("Prvi koji je dosao je cekao {0} sati i {1} minuta.", ch, cm);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement