0
c를이 같은 TXT에 데이터가 0,0,6열 #
개구리, 0010011111004000,5
개구리, 0010011111104000,5
선택한 열의 0 수를 계산해야합니다. 예를 들어 첫 번째 열에는 3 개의 0이 있습니다.
여기 내 코드는 지금까지 있습니다 :이를 해결하기위한
//data patch
string[] tekst = File.ReadAllLines(@"C:\zoo.txt");
//full of array
string[] tablica = tekst;
for(int s=0;s<tablica.Length;s++)
{
Console.WriteLine(tablica[s]);
}
//----------------Show all of array---------------------------//
//----------------Giv a number of column-----------------////
Console.WriteLine("Podaj kolumne");
int a = Convert.ToInt32(Console.ReadLine());
//Console.WriteLine("Podaj wiersz");
//int b = Convert.ToInt32(Console.ReadLine());
int n = tablica.Length;
int m = tablica[a].Split(',').Length;
string[,] liczby = new string[n, m];
for (int j = 0; j < n; j++)
{
int suma = 0;
for (int i = 0; i < m; i++)
{
//somethink should be here
}
}
어떤 아이디어?
시도해 보셨습니까? 무슨 문제 있니? – astidham2003
텍스트를 텍스트가 아닌 텍스트로 포함하십시오. –
나는이 0을 세는 방법을 모르겠다.()에 대해 두 번째를 넣고 txt를 텍스트로 추가 할 생각이 없다. – Domi