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 Exercise_1
- {
- class Program
- {
- static void Main(string[] args)
- {
- while(true)
- {
- Console.Write("Število 1: ");
- string a = Console.ReadLine();
- Console.Write("Število 2: ");
- string b = Console.ReadLine();
- Console.Write("Število 3: ");
- string c = Console.ReadLine();
- int x = Convert.ToInt32(a);
- int y = Convert.ToInt32(b);
- int z = Convert.ToInt32(c);
- int min = 1;
- int max = 1;
- if (x < y && x < z)
- {
- min = x;
- }
- else if (x > y && x > z)
- {
- max = x;
- }
- if (y < x && y < z)
- {
- min = y;
- }
- else if (y > x && y > z)
- {
- max = y;
- }
- if (z < x && z < y)
- {
- min = z;
- }
- else if (z > x && z > y)
- {
- max = z;
- }
- if (x == y || y == z)
- {
- min = x;
- max = z;
- }
- if (x == y || x == z)
- {
- min = x;
- max = y;
- }
- else if (x == y && y ==z)
- {
- min = x;
- max = y;
- }
- int prod = min * max;
- Console.WriteLine();
- Console.WriteLine("Zmnožek števil je " + prod.ToString());
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement