Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 0.54 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7.  {
  8.   int m[4][4], v[4] = {0,0,0,0}, i = 0,j = 0;
  9.  
  10.   cout<<"Introduzca enteros para llenar una matríz de 4 renglones y cuatro columnas";
  11.   for(i = 0; i < 4; i++)
  12.    for(j = 0; i < 4; i++)
  13.     {
  14.      cin>>m[i][j];
  15.      v[i] += m[i][j];
  16.     }
  17.      
  18.     cout<<"Matriz y promedio de cada función\n";
  19.     for(i = 0; i < 4; i++)
  20.      {
  21.       for(j = 0; j < 4; j++)
  22.       cout<<m[i][j]<<"";
  23.        cout<<v[i]/4<<"\n";
  24.      }
  25.      _getch();
  26.      return 0;
  27.      }