Algoritmik tillar va dasturlash Fanidan bajargan topshiriqlar toplami. Mavzular


-Topshiriq Mamirov Javohir 6, 25 missollar



Download 3,12 Mb.
bet3/13
Sana22.07.2022
Hajmi3,12 Mb.
#835748
1   2   3   4   5   6   7   8   9   ...   13
Bog'liq
Malakaviy Amaliyot Mamirov Javohir

5-Topshiriq Mamirov Javohir 6, 25 missollar

6. Berilgan to‘rt xonali son raqamlarining ko‘paytmasi topilsin.



6-topshiriq:
using System;

namespace Amaliyot


{
class Program
{
static void Main(string[] args)
{
int n;
Console.WriteLine("berilgan sonni kiriting:");
n = Convert.ToInt32(Console.ReadLine());
int a, b, c, d;
a = n % 10;
n = n / 10;
b = n % 10;
n = n / 10;
c = n % 10;
n = n / 10;
d = n % 10;
int S = a * b * c * d;
Console.WriteLine(S);
}
}
}

25-Topshiriq:


using System;

namespace Amaliyot


{
class Program
{
static void Main(string[] args)
{
double R1, R2, R3, R;
Console.WriteLine("elektr qarshiliklarini kiriting:");
R1 = Convert.ToDouble(Console.ReadLine());
R2 = Convert.ToDouble(Console.ReadLine());
R3 = Convert.ToDouble(Console.ReadLine());
R = 1 / R1 + 1 / R2 + 1 / R3;
R = 1 / R;
Console.WriteLine("R="+Math.Round(R,4));
}
}
}


Mamirov Javohir 6,7- amaliy topshiriq

1.14-misol:

Yechilishi:
using System;

namespace Amaliyot


{
class Program
{
static void Main(string[] args)
{
double x, y;
Console.Write("x=");
x = Convert.ToDouble(Console.ReadLine());
Console.Write("y=");
y = Convert.ToDouble(Console.ReadLine());
bool a = (Math.Abs(x) <= 1) == (Math.Abs(y) >= 1);
bool b = (x * x + y * y <= 4) == (y <= x);
Console.WriteLine("a:" + a + " b:" + b);
}
}
}

using System;

namespace Amaliyot


{
class Program
{
static void Main(string[] args)
{
bool a, b,c;
Console.Write("a=");
a = Convert.ToBoolean(Console.ReadLine());
Console.Write("b=");
b = Convert.ToBoolean(Console.ReadLine());
Console.Write("c=");
c = Convert.ToBoolean(Console.ReadLine());
bool x = !(a || b) == (!a) && (!b);
bool y = a && (b || c) == (a && b) || (a && c);
Console.WriteLine("a-misol:" + x+ " b-misol:" + y);
}
}
}

2.2-misol:

Yechilishi:
using System;

namespace Amaliyot


{
class Program
{
static void Main(string[] args)
{
double x;
Console.Write("x=");
x = Convert.ToDouble(Console.ReadLine());
double y=0;
if(-2<=x && x < 2)
{
y+= x * x;
}
else if (x < -2)
{
y+= x * x + 4 * x + 5;
}
else if (x >= 2)
{
y+= 2 - x;
}
Console.WriteLine("y=" + y);
}
}
}

2.18-misol:

Yechilishi:
using System;

namespace Amaliyot


{
class Program
{
static void Main(string[] args)
{
double x;
Console.Write("x=");
x = Convert.ToDouble(Console.ReadLine());
double y=0; double a = 2; double b = 0.5;
if(x < 1)
{
y+= 1;
}
else if (1<=x && x<=2)
{
y+= a*x*x*Math.Log(x);
}
else if (x>2)
{
y+= Math.Exp(a*x)*Math.Cos(b*x);
}
Console.WriteLine("y=" + y);
}
}
}

3.1-misol:

Yechilishi:
using System;

namespace Amaliyot


{
class Program
{
static void Main(string[] args)
{
int a, b, c;
Console.Write("a=");
a = Convert.ToInt32(Console.ReadLine());
Console.Write("b=");
b = Convert.ToInt32(Console.ReadLine());
Console.Write("c=");
c = Convert.ToInt32(Console.ReadLine());
int y = 0;
if(a==b && b == c)
{
y += 3;
}
else if(a==b || b==c || a == c)
{
y += 2;
}
else if (a + b <= c)
{
y += 0;
}
else if (a + b > c)
{
y += 1;
}
Console.WriteLine("y="+y);
}
}
}

3.17-misol:
17. Natural n (n  9999 ) soni berilgan. Sonni to‘rt xonali deb hisobga olgan holda ushbu sonning palindrom ekanligi aniqlansin (chapdan va o‘ngdan bir xil o‘qiladigan sonlar, masalan, 1221, 5555,4444 sonlari palindrom sonlar hisoblanadi).
Yechilishi:
using System;

namespace Amaliyot


{
class Program
{
static void Main(string[] args)
{
int n;
Mine:
Console.Write("n=");
n = Convert.ToInt32(Console.ReadLine());
if(n>9999 && n<1000)
{
Console.WriteLine("bu son shartga mos emas! boshqattan urinib koring!");
goto Mine;
}
int x, y, z, w;
x = n % 10;
n = n / 10;
y = n % 10;
n = n / 10;
z = n % 10;
n = n / 10;
w = n % 10;
if (x * 10 + y == z + w * 10)
{
Console.WriteLine("bu son polindrom");
}
else
{
Console.WriteLine("bu son polindrom emas");
}
}
}
}

8-9 topshiriq
1-Amaliy
15-misol

using System;
using System.Collections;

namespace Amaliyot


{
class Program
{
static void Main(string[] args)
{
int n;
Console.Write("yilni kiriting:");
n = Convert.ToInt32(Console.ReadLine());
int s = Math.Abs(n-1984);
int a = s % 60;
int b = a % 12;
if (a <= 12)
{
Console.Write("yashil ");
switch (b)
{
case 1: Console.Write("sichqon "); break;
case 3: Console.Write("yolbars "); break;
case 4: Console.Write("quyon "); break;
case 5: Console.Write("ajdarho "); break;
case 6: Console.Write("ilon "); break;
case 7: Console.Write("ot "); break;
case 8: Console.Write("qo‘y "); break;
case 9: Console.Write("maymun "); break;
case 10: Console.Write("tovuq "); break;
case 11: Console.Write("it "); break;
case 0: Console.Write("to‘ng‘iz "); break;
case 2: Console.Write("sigir "); break;
}
}
else if(a > 12 && a <= 24)
{
Console.Write("qizil ");
switch (b)
{
case 1: Console.Write("sichqon "); break;
case 3: Console.Write("yolbars "); break;
case 4: Console.Write("quyon "); break;
case 5: Console.Write("ajdarho "); break;
case 6: Console.Write("ilon "); break;
case 7: Console.Write("ot "); break;
case 8: Console.Write("qo‘y "); break;
case 9: Console.Write("maymun "); break;
case 10: Console.Write("tovuq "); break;
case 11: Console.Write("it "); break;
case 0: Console.Write("to‘ng‘iz "); break;
case 2: Console.Write("sigir "); break;
}
}
else if (a > 24 && a <= 36)
{
Console.Write("sariq ");
switch (b)
{
case 1: Console.Write("sichqon "); break;
case 3: Console.Write("yolbars "); break;
case 4: Console.Write("quyon "); break;
case 5: Console.Write("ajdarho "); break;
case 6: Console.Write("ilon "); break;
case 7: Console.Write("ot "); break;
case 8: Console.Write("qo‘y "); break;
case 9: Console.Write("maymun "); break;
case 10: Console.Write("tovuq "); break;
case 11: Console.Write("it "); break;
case 0: Console.Write("to‘ng‘iz "); break;
case 2: Console.Write("sigir "); break;
}
}
else if (a > 36 && a <= 48)
{
Console.Write("oq ");
switch (b)
{
case 1: Console.Write("sichqon "); break;
case 3: Console.Write("yolbars "); break;
case 4: Console.Write("quyon "); break;
case 5: Console.Write("ajdarho "); break;
case 6: Console.Write("ilon "); break;
case 7: Console.Write("ot "); break;
case 8: Console.Write("qo‘y "); break;
case 9: Console.Write("maymun "); break;
case 10: Console.Write("tovuq "); break;
case 11: Console.Write("it "); break;
case 0: Console.Write("to‘ng‘iz "); break;
case 2: Console.Write("sigir "); break;
}
}
else if (a > 48 && a <= 60)
{
Console.Write("qora ");
switch (b)
{
case 1: Console.Write("sichqon "); break;
case 3: Console.Write("yolbars "); break;
case 4: Console.Write("quyon "); break;
case 5: Console.Write("ajdarho "); break;
case 6: Console.Write("ilon "); break;
case 7: Console.Write("ot "); break;
case 8: Console.Write("qo‘y "); break;
case 9: Console.Write("maymun "); break;
case 10: Console.Write("tovuq "); break;
case 11: Console.Write("it "); break;
case 0: Console.Write("to‘ng‘iz "); break;
case 2: Console.Write("sigir "); break;
}
}
Console.WriteLine("yil");

}
}
}



2-Amaliy
14-misol

24-misol


using System;
using System.Collections;

namespace Amaliyot


{
class Program
{
static void Main(string[] args)
{
int n;
Console.Write("n:");
n = Convert.ToInt32(Console.ReadLine());
int n1 = n;
string s=n.ToString();
int r = s.Length;
int[] f = new int[r];
for (int i = 0; i < f.Length; i++)
{
f[i] = n % 10;
n = n % 10;
}
int S = 0;
for (int i = 0; i < f.Length; i++)
{
S += f[i];
}
if (S == n1)
{
Console.WriteLine("Bu son mukammal son!!!");
}
else
{
Console.WriteLine("Bu son mukammal son emas!!!");
}
}
}
}



Download 3,12 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   13




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish