Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Citire_matrici_afisare_matrici
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i, j, n, m , s = 0;
- int[,] v;
- Console.Write("n= ");
- n = int.Parse(Console.ReadLine());
- Console.Write("m= ");
- m = int.Parse(Console.ReadLine());
- v = new int[n,m];
- for (i = 0; i <= n-1; i++)
- for (j = 0; j <= m-1; j++)
- {
- v[i,j] = int.Parse(Console.ReadLine());
- s = s + v[i, j];
- }
- Console.WriteLine("Suma este = {0}", s);
- for (i = 0; i <= n-1; i++)
- {
- for (j = 0; j <= m-1; j++)
- Console.Write("{0} ", v[i, j]);
- Console.WriteLine("");
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement