Люди добрые перевести код из с++ в c#. , !
{
int size = datagridview1-> rowcount - 1;
system: : io: : streamwriter^ fp = system: : io: : file: : createtext("output.txt");
fp-> writeline(size);
for (int i = 0; i < size; i++)
{
system: : string^ temp = gcnew system: : string(my_cmp[i].name.;
fp-> writeline(temp);
fp-> writeline(my_cmp[i].tp);
fp-> writeline(my_cmp[i].sopf);
fp-> writeline(my_cmp[i].count);
fp-> writeline(my_cmp[i].pt);
fp-> writeline(my_cmp[i].fo);
}
fp-> close();
}
type Oras = (Chisinau, Orhei, Balti, Tigina, Tiraspol);
Zi = (L, Ma, Mi, J, V, S, D);
Consum = array [Oras, Zi] of real;
var C : Consum;
r : Oras;
z : Zi;
i,k : integer;
sum,min_r,max_r,min_z,max_z:real;
n_max_r,n_min_r,n_max_z,n_min_z:integer;
begin
r:=Chisinau;
randomize;
for i:=1 to 5 do
begin
z:=L;
for k:=1 to 7 do
begin
c[r,z]:=random*100;
z:=succ(z);
end;
r:=succ(r);
end;
r:=Chisinau;
for i:=1 to 5 do
begin
z:=L;
case ord(r) of
0:writeln('Chisinau');
1:writeln('Orhei');
2:writeln('Balti');
3:writeln('Tigina');
4:writeln('Tiraspol');
end;
for k:=1 to 7 do
begin
write(c[r,z]:6:2);
z:=succ(z);
end;
r:=succ(r);
writeln;
end;
writeln('Vsego za nedelu');
r:=Chisinau;
min_r:=99999;
max_r:=0;
n_min_r:=-1;
n_max_r:=-1;
for i:=1 to 5 do
begin
z:=L;
case ord(r) of
0:write('Chisinau sum=');
1:write('Orhei sum=');
2:write('Balti sum=');
3:write('Tigina sum=');
4:write('Tiraspol sum=');
end;
sum:=0;
for k:=1 to 7 do
begin
sum:=sum+c[r,z];
z:=succ(z);
end;
if sum>max_r then
begin
max_r:=sum;
n_max_r:=ord(r);
end;
if sum<min_r then
begin
min_r:=sum;
n_min_r:=ord(r);
end;
r:=succ(r);
writeln(sum:8:2);
end;
writeln('Po dnyam nedeli');
z:=L;
min_z:=99999;
max_z:=0;
n_min_z:=-1;
n_max_z:=-1;
for k:=1 to 7 do
begin
r:=Chisinau;
case ord(z) of
0:write('L sum=');
1:write('Ma sum=');
2:write('Mi sum=');
3:write('J sum=');
4:write('V sum=');
5:write('S sum=');
6:write('D sum=');
end;
sum:=0;
for i:=1 to 5 do
begin
sum:=sum+c[r,z];
r:=succ(r);
end;
if sum>max_z then
begin
max_z:=sum;
n_max_z:=ord(z);
end;
if sum<min_z then
begin
min_z:=sum;
n_min_z:=ord(z);
end;
z:=succ(z);
writeln(sum:8:2);
end;
writeln('Gorod c maximalnim potrebleniem');
r:=Chisinau;
for i:=1 to 5 do
begin
if ord(r)=n_max_r then
case ord(r) of
0:writeln('Chisinau');
1:writeln('Orhei');
2:writeln('Balti');
3:writeln('Tigina');
4:writeln('Tiraspol');
end;
r:=succ(r);
end;
writeln('Gorod c minimalnim potrebleniem');
r:=Chisinau;
for i:=1 to 5 do
begin
if ord(r)=n_min_r then
case ord(r) of
0:writeln('Chisinau');
1:writeln('Orhei');
2:writeln('Balti');
3:writeln('Tigina');
4:writeln('Tiraspol');
end;
r:=succ(r);
end;
writeln('Den c maximalnim potrebleniem');
z:=L;
for k:=1 to 7 do
begin
if ord(z)=n_max_z then
case ord(z) of
0:writeln('L');
1:writeln('Ma');
2:writeln('Mi');
3:writeln('J');
4:writeln('V');
5:writeln('S');
6:writeln('D');
end;
z:=succ(z);
end;
writeln('Den c minimalnim potrebleniem');
z:=L;
for k:=1 to 7 do
begin
if ord(z)=n_min_z then
case ord(z) of
0:writeln('L');
1:writeln('Ma');
2:writeln('Mi');
3:writeln('J');
4:writeln('V');
5:writeln('S');
6:writeln('D');
end;
z:=succ(z);
end;
readln;
end.
ответ надо продемонстрировать рисунком, я не умею на компьютере, поэтому рисую такую схему,как разместить зайцев в прямоугольной клетке.
З -это заяц,их должно быть 5:
Три зайца по углам и два у стенок по одному.
З З Это задача для малышей,ее каждый ребенок знает.
З
З З