Guest User

Untitled

a guest
Jan 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.IO;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13. static void int Main()
  14. {
  15. MaxArray MaxFinder = new MaxArray("myfile.txt", 10, 5);
  16. }
  17. public class MaxArray
  18. {
  19. private int[,] m_matrix;
  20.  
  21. public MaxArray(string arrayFileName, int m, int n)
  22. {
  23. m_matrix = new int[m,n];
  24.  
  25. FileStream file = new FileStream(arrayFileName, FileMode.Open, FileAccess.Read);
  26. StreamReader reader = new StreamReader(file);
  27.  
  28.  
  29. // verify "arrayFileName" is actually a valid file that exists
  30. // open the file
  31. // read the contents into m_matrix[][]
  32. // make sure you are safe not to accidentally go out of bounds on array
  33. }
  34.  
  35. public int MaxFinder(int m, int n)
  36. {
  37. int maxValue = 0;
  38.  
  39. if(m > maxValue)
  40. {
  41. maxValue = m;
  42. }
  43. else if (n > maxValue)
  44. {
  45. maxValue = n;
  46. }
  47. return maxValue;
  48.  
  49.  
  50. // loop through all rows & columns of m_matrix
  51. // if (value > maxValue)
  52. // store biggest value
  53. // should we PRINT OUT the value?
  54. }
  55. }
  56.  
  57.  
  58. public partial class Form1 : Form
  59. {
  60. public Form1()
  61. {
  62. InitializeComponent();
  63. }
  64.  
  65. private void Form1_Load(object sender, EventArgs e)
  66. {
  67.  
  68. }
  69. }
  70. }
Add Comment
Please, Sign In to add comment