Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.IO;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- static void int Main()
- {
- MaxArray MaxFinder = new MaxArray("myfile.txt", 10, 5);
- }
- public class MaxArray
- {
- private int[,] m_matrix;
- public MaxArray(string arrayFileName, int m, int n)
- {
- m_matrix = new int[m,n];
- FileStream file = new FileStream(arrayFileName, FileMode.Open, FileAccess.Read);
- StreamReader reader = new StreamReader(file);
- // verify "arrayFileName" is actually a valid file that exists
- // open the file
- // read the contents into m_matrix[][]
- // make sure you are safe not to accidentally go out of bounds on array
- }
- public int MaxFinder(int m, int n)
- {
- int maxValue = 0;
- if(m > maxValue)
- {
- maxValue = m;
- }
- else if (n > maxValue)
- {
- maxValue = n;
- }
- return maxValue;
- // loop through all rows & columns of m_matrix
- // if (value > maxValue)
- // store biggest value
- // should we PRINT OUT the value?
- }
- }
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- }
- }
Add Comment
Please, Sign In to add comment