122-20 “AT va T” guruh talabasi Aliqobilov Madiyor 10- amaliy topshiriq
variant
1-topshiriqlar
int m,n;
Console.Write("Ustunlar sonini kiriting=");
n=Convert.ToInt32(Console.ReadLine());
Console.Write("Satrlar sonini kiriting=");
m=Convert.ToInt32(Console.ReadLine());
int [,] a= new int[m,n];
for(int i=0;i
for(int j=0;j
Console.Write("A["+i+","+j+"]="+i*10+" ");
}
}
___________________________________________________________________________________
2-topshiriqlarim
int m,n,j,p=0;
Console.Write("Satrlar sonini kiriting=");
m=Convert.ToInt32(Console.ReadLine());
Console.Write("Ustunlar sonini kiriting=");
n=Convert.ToInt32(Console.ReadLine());
int [,] a= new int[m,n];
for(int i=0;i
for( j=0;j
Console.Write("A["+i+","+j+"]=");
a[i,j]=Convert.ToInt32(Console.ReadLine());
} }
int k=0;
for( j=0;j
for(int i=0;i
if (a[i,j]%2==1){
k++;
} } }
for (int i=0;i
for( j=0;j
Console.Write("a["+i+","+j+"]="+a[i,j]+" ");
}Console.WriteLine();
}
if(k==m){
Console.Write(p+"- ustunda faqat toq sonlar bor!");
}else Console.Write("Bu "+m+"*"+n+" matritsada faqat toq sonlardan iborat ustun mavjud emas!");
// Ustoz bu misolni javobi chiqmadi lekin o`ylashimcha hammasini to`g`ri qildim !!!
Do'stlaringiz bilan baham: |