Abdumajidova Mukarramxon 2-amaliy mashg’uloti


Download 13.79 Kb.
Sana23.02.2023
Hajmi13.79 Kb.
#1224313

Abdumajidova Mukarramxon
2-amaliy mashg’uloti

2_masala mxn o’lchamli matrisa berilgan.Matrisaning har bir satri uchun uning elementlari yig’indisini hisoblovchi dastur tuzilsin.


C# dagi korishi
using System;
namespace 2_masala
class Program
{
{
public static void Main(string[] args)
int m,n;
Console.Write("Massivning satrlari sonini kiriting: m = ");
ustunlari sonini kiriting: n=");
m = int.Parse(Console.ReadLine());
Console.Write("Massivning
n-int.Parse(Console.ReadLine());
int[] a= new int[m,n]; int [] s= new int[m];
for (int i=0;i{
for (int j = 0; j{
}
}
Console.Write("a ["+i+","+j+"] = ");
a[i,j]-int.Parse(Console.ReadLine());
s[i]+= a[i,j];
}
for (int i=0;i< m;i++)
{
Console.WriteLine(it"-satr elementlari yig'indisi: "+s[i]);

Console.ReadKey(true);


L
Download 13.79 Kb.

Do'stlaringiz bilan baham:




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