Using System; namespace Berdiyor



Download 21,31 Kb.
Sana31.12.2021
Hajmi21,31 Kb.
#277986
Bog'liq
voris class

using System;

namespace Berdiyor

{

class method



{

public void Massiv()

{

int m, l=0,k=0;



Console.Write("m= ");

m = Convert.ToInt32(Console.ReadLine());

int[] a = new int[m];

for (int i = 0; i < m; i++)

{
Console.Write("a[" + i + "]=");

a[i] = Convert.ToInt32(Console.ReadLine());


}
for (int i = 0; i < m; i+=2)

{

if (a[i] % 2 == 0)



{

k++;


}

else { Console.WriteLine(i); break; }

}

for (int i = 0; i < m; i += 2)



{

if (a[i + 1] % 2 == 1)

{

l++;


}

else { Console.WriteLine(i + 1); break; }

}

if (k == 1 && l == 1) { Console.WriteLine("y"); } else { Console.WriteLine("n "); }


}

}



class Program

{

static void Main()



{

method ask = new method();

ask.Massiv();

}

}



}

Voris sinf yaratish

Odam classi

using System;

class odam

{

public int yoshi;



public string ismi;

public int BHM = 243000;

}

class oquvchi : odam



{

public int sinf = 5;

}

class oqituvchi : odam



{

public int maoshi;

public void hisob()

{

Console.Write("Maoshi= ");



Console.WriteLine(3 * BHM + " so'm");

}

}



class shafyur : odam

{

int g;



public int kira;

public void naqt()

{

Console.Write("qatnov sonini kiriting = ");



g = Convert.ToInt32(Console.ReadLine());

Console.Write("summasi = ");

Console.WriteLine(g * BHM + " so'm");

}

}



class Program

{

static void Main()



{

int g;


odam o = new odam();

oquvchi i = new oquvchi();

oqituvchi h = new oqituvchi();

shafyur d = new shafyur();

Console.Write(i.sinf + "-sinf ismi ");

i.ismi = "Muhammad";

d.ismi = "Kamol";

h.ismi = "Dilmurod";

Console.WriteLine(i.ismi);

Console.WriteLine(h.ismi);

h.hisob();

Console.WriteLine(d.ismi);

d.naqt();

}

}



/*

using System;

class inson

{

public int yoshi;



public string ismi;

public int BHM = 243000;

}

class talaba : inson



{

public int kursi = 3;

}

class oqituvchi : inson



{

public int maoshi;

public void hisob()

{

Console.WriteLine(4 * BHM);



}

}

class Program



{

static void Main()

{

inson s = new inson();



talaba t = new talaba();

// Console.WriteLine(t.kursi);

t.ismi = "Komil";

oqituvchi o = new oqituvchi();

o.ismi = " Dilmurod";

Console.WriteLine("talaba "+t.kursi);

Console.WriteLine(t.ismi);

Console.WriteLine(o.ismi);

o.hisob();

}

}



*/
/*using System;

namespace Berdiyor

{

class method



{

public void Massiv()

{

int m, l=0,k=0;



Console.Write("m= ");

m = Convert.ToInt32(Console.ReadLine());

int[] a = new int[m];

for (int i = 0; i < m; i++)

{
Console.Write("a[" + i + "]=");

a[i] = Convert.ToInt32(Console.ReadLine());


}
for (int i = 0; i < m; i+=2)

{

if (a[i] % 2 == 0)



{

k++;


}

else { Console.WriteLine(i); break; }

}

for (int i = 0; i < m; i += 2)



{

if (a[i + 1] % 2 == 1)

{

l++;


}

else { Console.WriteLine(i + 1); break; }

}

if (k == 1 && l == 1) { Console.WriteLine("y"); } else { Console.WriteLine("n "); }


}

}



class Program

{

static void Main()



{

method ask = new method();

ask.Massiv();

}

}



}

*/

19-avgust



#1 Revision

using System;

using static System.Math;

namespace Berdiyor

{

class Program



{

static void Main()

{

double x1, x2, F;



int c, d;

Console.Write("x1= ");

x1 = Convert.ToDouble(Console.ReadLine());

Console.Write("x2= ");

x2 = Convert.ToDouble(Console.ReadLine());

Console.Write("c= ");

c = Convert.ToInt32(Console.ReadLine());

Console.Write("d= ");

d = Convert.ToInt32(Console.ReadLine());

F = Abs(Pow(Sin(Abs(c * Pow(x2, 3) + d * Pow(x1, 3) - c * d)),2) / Sqrt((c * Pow(x1, 2) + d * Pow(x2, 2) + 5) + 2)) + Tan(x1 * Pow(x2, 2) + Pow(d, 3));

Console.WriteLine($"F= +{F:F2}");

}

}



}

#4 Revision

Aylana haqidagi misol

using System;

using static System.Math;

namespace Berdiyor

{

class Program



{

static void Main()

{

double a, x, y, A;



Console.Write("x1= ");

x = Convert.ToDouble(Console.ReadLine());

Console.Write("x1= ");

y = Convert.ToDouble(Console.ReadLine());

A = Sqrt(x * x + y * y);

if(A>=0 && A <= 1)

{

Console.WriteLine("Yes");



}

else


{

Console.WriteLine("No");

}

}

}



}

#2 Revision

using System;

using static System.Math;

namespace Berdiyor

{

class Program



{

static void Main()

{

double z, x, y, A;



Console.Write("x1= ");

x = Convert.ToDouble(Console.ReadLine());

Console.Write("x1= ");

y = Convert.ToDouble(Console.ReadLine());

Console.Write("x1= ");

z = Convert.ToDouble(Console.ReadLine());

A = Min(x, Min(y, z));

if (x < 1 & y < 1 & z < 1)

{

if (A == x)



{

x = (y + z) / 2;

}

if (A==y)



{

y = (x + z) / 2;

}

if (A == z)



{

z = (x + y) / 2;

}

Console.WriteLine($"{x},{y},{z}");



}

}

}



}
Download 21,31 Kb.

Do'stlaringiz bilan baham:




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