C# программалау тілі. Ерекешева М.М.
static
void
Main(
string
[] args)
{
string
st;
int
i, k = 0, n = 0, m = 0, j;
string
[] s =
new
string
[7];
FileStream
Fft =
new
F
ileStream
(
"gol1.txt"
,
FileMode
.Open, F
leAccess
.Read);
StreamReader
Rd =
new
StreamReader
(Fft);
while
(Rd.Peek() > 0)
{
st = Rd.ReadLine();
s[m] = st;
Console
.WriteLine(st);
n = st.Length;
k = 0;
for
(i = 0; i <= n - 1; i++)
if
(st[i] ==
'i'
) k++;
if
(k == 5)
Console
.WriteLine(st);
m++;
}
for
(j = m - 1; j >= 0; j--)
Console
.WriteLine(s[j]); }
}
}
Достарыңызбен бөлісу: