Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- public static class Program
- {
- static void Main()
- {
- string file="marks2D.txt";
- string outfile="average.csv";
- StreamReader sr= new StreamReader(file);
- StreamWriter outstream= new StreamWriter(outfile);
- //double[] field=new double [0];
- string[,] temp=new string[5,6];
- int num=0;
- double ave=0;
- for(int i=0; i<temp.GetLength(0); i++)
- {
- double sum=0;
- string line=sr.ReadLine();
- //temp=line.Split(',');
- for(int j=0; j<temp.GetLength(1); j++)
- {
- double m=double.Parse(line);
- ave = m/5;
- temp[num]=line;
- outstream.WriteLine(ave);
- //Console.Write("{0,1}", temp[i,j]);
- }
- outstream.WriteLine(field[num]);
- }
- Console.WriteLine();
- sr.Close();
- outstream.Close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement