Fan: Algoritmik tillar va dasturlash 2020-2021 o’quv yili Topshiriq №3
Variant №15. Uchta son berilgan. Shu sonlarning yig’indisi eng katta bo’ladigan ikkitasini topish dasturi tuzilsin.
Masalaninig C# dasturlash tilidagi matni:
using System;
namespace Zilola
{
class Program
{
public static void Main(string[] args)
{
double a,b,c;
Console.Write("Birinchi sonni kiriting: ");
a=double.Parse(Console.ReadLine());
Console.Write("Ikkinchi sonni kiriting: ");
b=double.Parse(Console.ReadLine());
Console.Write("Uchinchi sonni kiriting: ");
c=double.Parse(Console.ReadLine());
if (a==b & b==c)
Console.Write("Bu sonlar teng: "+a);
else
{
if ((a+b)>(a+c)) Console.Write(a+" va "+b);
else
{
if ((b+c)>(a+c)) Console.Write(b+" va "+c);
else Console.Write(a+" va "+c);
}
}
Console.ReadKey(true);
}
}
}
Natija:
Bajardi: Z.Shokirova Qabul qildi: Sh.Farmonov
Do'stlaringiz bilan baham: |