Abramyan masalar to'plami
43 subscribers
1 photo
1 video
1 file
2 links
Abramyan masalalar to'plami yechimlari bilan birga C# dasturlash tilida o'zbekcha talqinda
Download Telegram
#boolean24
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int a, b, c;
Console.WriteLine("a ni kirit :");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("b ni kirit :");
b= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("c ni kirit :");
c = Convert.ToInt32(Console.ReadLine());
bool y = ((a != 0) &&( b * b - 4 * a * c >= 0));
Console.WriteLine(y);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean25
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int x,y;
Console.WriteLine("x ni kirit :");
x = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y ni kirit :");
y= Convert.ToInt32(Console.ReadLine());


bool d = x < 0 && y > 0;
Console.WriteLine(d);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean26
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int x,y;
Console.WriteLine("x ni kirit :");
x = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y ni kirit :");
y= Convert.ToInt32(Console.ReadLine());


bool d = x > 0 && y < 0;
Console.WriteLine(d);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean27
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int x,y;
Console.WriteLine("x ni kirit :");
x = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y ni kirit :");
y= Convert.ToInt32(Console.ReadLine());


bool d =( x < 0 && y > 0) || (x >0 && y<0);
Console.WriteLine(d);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int x,y;
Console.WriteLine("x ni kirit :");
x = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y ni kirit :");
y= Convert.ToInt32(Console.ReadLine());


bool d = (x > 0 && y > 0) || ( x< 0 && y <0);
Console.WriteLine(d);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int x,y,x1,x2,y1,y2;
Console.WriteLine("x ni kirit :");
x = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y ni kirit :");
y= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("x1 ni kirit :");
x1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y1 ni kirit :");
y1= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("x2 ni kirit :");
x2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y2 ni kirit :");
y2= Convert.ToInt32(Console.ReadLine());



bool d = (Math.Abs(x1-x2)* Math.Abs(y1-y2)) && (x >0 && y > 0);)
Console.WriteLine(d);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean30
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int a,b,c;
Console.WriteLine("a ni kirit :");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("b ni kirit :");
b= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("c ni kirit :");
c = Convert.ToInt32(Console.ReadLine());

bool d = (a == b && b == c);
Console.WriteLine(d);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean31
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int a,b,c;
Console.WriteLine("a ni kirit :");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("b ni kirit :");
b= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("c ni kirit :");
c = Convert.ToInt32(Console.ReadLine());

bool d = (a == b && b != c)|| (b==c && c!=a)||(a==c && c!=b);
Console.WriteLine(d);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean32
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int a,b,c;
Console.WriteLine("a ni kirit :");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("b ni kirit :");
b= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("c ni kirit :");
c = Convert.ToInt32(Console.ReadLine());

bool d = (a*a+b*b ==c*c) || (b*b+c*c ==a*a) || (a*a+c*c== b*b);
Console.WriteLine(d);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int a,b,c;
Console.WriteLine("a ni kirit :");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("b ni kirit :");
b= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("c ni kirit :");
c = Convert.ToInt32(Console.ReadLine());

bool d = (a+b>c) || (b+c >a) || (a+c>b);
Console.WriteLine(d);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
int x,y;
Console.WriteLine("x > 1 dan 8 gacha son kiriting :");
x = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y> 1 dan 8 gacha son kiriting :");
y= Convert.ToInt32(Console.ReadLine());


bool oqrang = (x%2==1 && y%2==0 ) || (x%2==0 && y%2==1) ;
Console.WriteLine(oqrang);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication
class Program
{
static void Main(string[] args)
{
int x1,y1,x2,y2;
Console.WriteLine("x1 > 1 dan 8 gacha son kiriting :");
x1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y1 > 1 dan 8 gacha son kiriting :");
y1= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("x2> 1 dan 8 gacha son kiriting :");
x2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y2 > 1 dan 8 gacha son kiriting :");
y2 = Convert.ToInt32(Console.ReadLine());


bool birxilranglar = ((x1 % 2 == 1 && y1 % 2 == 0) || (x1 % 2 == 0 && y1 % 2 == 1)) && ((x2 % 2 == 1 && y2 % 2 == 0) || (x2 % 2 == 0 && y2 % 2 == 1)) || ((x1 % 2 == 1 && y1 % 2 == 1) || (x1 % 2 == 0 && y1 % 2 == 0)) || ((x1 % 2 == 1 && y1 % 2 == 1) || (x1 % 2 == 0 && y1 % 2 == 0));
Console.WriteLine(birxilranglar);
Console.ReadKey();
}
}
}

@c_sharp1
#boolean36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
int x1,y1,x2,y2;
Console.WriteLine("x1 ni kirit :");
x1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y1 ni kirit :");
y1= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("x2 ni kirit :");
x2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("y2 ni kirit :");
y2 = Convert.ToInt32(Console.ReadLine());


bool ruhyurishi = ((x1+y1)%2==1 ) || ( (x1 + y1) % 2 == 0);
Console.WriteLine(ruhyurishi);
Console.ReadKey();
}
}
}

@c_sharp1
Assalom aleykum 🙋‍♀
Endi navbat If operatoriga oid masalarga😊 Yechimini esa har doimgiday C# dasturlash tilida ko'rib chiqamiz😉

⚙️ if

@c_sharp1
#if1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{

int a;
Console.WriteLine("a ni kirting :");
a = Convert.ToInt32(Console.ReadLine());

if (a>0)
{
a = a + 1;
}
else
{
a = a;

}
Console.WriteLine(a);
}
}
}

@c_sharp1
#if2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{

int a;
Console.WriteLine("a ni kirting :");
a = Convert.ToInt32(Console.ReadLine());

if (a>0)
{
a = a + 1;
}
else
{
a = a-2;

}
Console.WriteLine(a);
}
}
}

@c_sharp1
#if3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{

int a;
Console.WriteLine("a ni kirting :");
a = Convert.ToInt32(Console.ReadLine());

if (a>0)
{
a = a + 1;
}
if (a<0)
{
a = a-2;

}
else
{
a = 10;
}
Console.WriteLine(a);
}
}
}


@c_sharp1