Using System; namespace yangilar { class Program { public
Download 41.5 Kb.
|
Begzod starista 140620230404
MT5 using System; namespace yangilar { class Program { public static void Main(string[] args) { Console.WriteLine("Matritsa satirlar sonini kiriting"); Console.Write("m="); int m=int.Parse(Console.ReadLine()); Console.WriteLine("Matritsa ustunlar sonini kiriting"); Console.Write("n="); int n=int.Parse(Console.ReadLine()); int [,] a=new int[m,n]; for(int i=0;i for(int b=0;b Console.Write("a[{0}{1}]=",i,b); a[i,b]=int.Parse(Console.ReadLine()); } } int k=a[0,0]; for(int i=0;i for(int b=0;b if((b!=n-1)) { if((a[i,b]>a[i,b+1])) { if((a[i,b] { Console.WriteLine(0); goto a; } } } if(b!=n-1) { if((a[i,b] { if((a[i,b]>a[i,b+1])) { Console.WriteLine(0); goto a; } } } if(a[i,b] k=a[i,b]; } } } Console.WriteLine("Eng kichik element "+k+" ga teng"); a: Console.ReadKey(true); } } } MT6
using System; namespace Masala_13 { class Program { public static void Main(string[] args) { Console.Write("Massivning satrlari sonini kiriting: m="); int m=int.Parse(Console.ReadLine()); double s=0,k=0; double [,] a=new double [m+1,m+1]; for (int i=1;i<=m;i++) { for (int j=1;j<=m;j++) { Console.Write("a[{0}{1}]=",i,j); a[i,j]=double.Parse(Console.ReadLine()); } } for(int i=1;i for(int j=1;j if((j==m+1-i)&&(j j++; } if((i==1)&&(j==m)) { } else { s=s+a[i,j]; k++; } } } Console.WriteLine("Yordamchi dioganalga paralel dioganallari elementlarini o`rta arifmetigi "+s/k+" ga teng"); Console.ReadKey(); } } } MT7
using System; namespace yangilar { class Program { public static void Main(string[] args) { Console.WriteLine("S satrni kiriting"); Console.Write("S="); string s=Console.ReadLine(); char [] mas={' ',}; string [] s3=s.Split(mas); Console.Write("Siz kiritgan malumotlardan foydalangan holda tuzilgan matn: "); int k=s3[0].Length; for(int i=0;i if(s[1]<=k) { k=s3[i].Length; } } Console.WriteLine("Probil bilan ajratilgan so`zlar soni "+(s3.Length-1)); Console.ReadKey(true); } } } MT8
using System; namespace yangilar { class yordamchi { public static void TrimRightC(string s, char c) { for(int i=0;i if(s[i]==c) goto a; Console.Write(s[i]); a: ; } Console.WriteLine(); } } class Program { public static void Main(string[] args) { Console.WriteLine("S satrni kiriting"); Console.Write("S="); string s=Console.ReadLine(); Console.WriteLine("C belgini kiriting"); Console.Write("C="); char c=char.Parse(Console.ReadLine()); yordamchi.TrimRightC(s,c); Console.ReadKey(true); } } } Amaliy 7
using System; namespace yangilar { class Program { public static void Main(string[] args) { Console.WriteLine("S satrni kiriting"); Console.Write("S="); string s=Console.ReadLine(); int r=0,l=0; for(int i=0;i if((s[i]>='a')&&(s[i]<='z')) { l++; } if((s[i]>='а')&&(s[i]<='я')) { r++; } } Console.WriteLine("Lotin alfavitidagi harflar soni "+l+" ta"); Console.WriteLine("Krill alfavitidagi harflar soni "+r+" ta"); Console.ReadKey(true); } } } Amaliy 8
using System; namespace yangilar { class yordamchi { public static void SortArray(int na, ref double [] a,ref double [] b,ref double [] c,ref int nb,ref int nc) { for(int i=0;i Console.Write("a[{0}]=",i); a[i]=double.Parse(Console.ReadLine()); } int k=0,l=0; for(int i=0;i if(a[i]%2==0) { b[k]=a[i]; k++; } else { c[l]=a[i]; l++; } } nb=k; nc=l; } } class Program { public static void Main(string[] args) { Console.WriteLine("A massiv elementlarini kiriting"); Console.Write("na="); int na=int.Parse(Console.ReadLine()); int nb=na,nc=na; double [] a=new double[na]; double [] b=new double[nb]; double [] c=new double[nc]; yordamchi.SortArray(na, ref a,ref b,ref c,ref nb,ref nc); Console.WriteLine("B masiv elementlar soni "+nb+" ga teng"); for(int i=0;i Console.Write("b[{0}]=",i); Console.Write(b[i]+" "); } Console.WriteLine(); Console.WriteLine("C masiv elementlar soni "+nc+" ga teng"); for(int i=0;i Console.Write("c[{0}]=",i); Console.Write(c[i]+" "); } Console.ReadKey(true); } } } Download 41.5 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling