matrix

by sss on March 10th, 2010
No notes
Syntax: No syntax
Show lines - Hide lines - Show in textbox - Download
#include <fstream>
using namespace std;
ifstream in("matrix.in");
ofstream out("matrix.out");
int main()
{
	int n,m,v[20][20],i,j;
	in>>n>>m;
	for (i=0;i<n;i++)
	{
	  for (j=0;j<m;j++)
		in>>v[i][j];
    }
	for (i=0;i<n;i++)
	{
	  for (j=0;j<m;j++)out<<v[i][j]<<" ";
	  out<<endl;
    }
    return 0;
}	
 

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS