
Matriz
Publicado por Jenny (3 intervenciones) el 27/01/2017 03:27:11
Hola espero que me puedan ayudar estoy haciendo una matriz y no me arroja resultado alguien me puede ayudar, a solucionar el error, y decirme como pedirle al usuario un numero y que multiplique ese numero a la matriz y la imprima.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
int respuesta = 0;
Console.WriteLine("cantidad de reglones");
int r = int.Parse(Console.ReadLine());
Console.WriteLine("cantidad de columnas");
int c = int.Parse(Console.ReadLine());
int[,] matriz = new int[r, c];
//Console.WriteLine("cantidad a multiplicar");
//respuesta = int.Parse(Console.ReadLine());
// COMIENZA CICLO PARA LLENAR LA PRIMERA MATRIZ
for (int i = 0; i < r; i++)
{
for (int j = 0; j < c; j++)
{
Console.WriteLine("matriz ingrese un valor en la posicion :{0},{1} ", i, j);
matriz[i, j] = int.Parse(Console.ReadLine());
}
}
// no me reconoce i, j
Console.WriteLine("resoltado es :" + matriz[i,j]);
Console.ReadLine();
}
}
}
Valora esta pregunta


0