Answer the question
In order to leave comments, you need to log in
Is it possible to convert pascal code to c#?
program matrix;
uses crt;
var a:array[1..100,1..200] of real;
b:array[1..100] of real;
i,j,n:integer;
x:real;
begin
writeln('input n');
readln(n);
writeln('input x');
readln(x);
for i:=1 to n do
for j:=1 to 2*n do
a[i,j]:=random(10)+random(100)/100;
writeln;
clrscr;
writeln('-------------------');
writeln('x=',x:6:3,' n=',n:6:3)
writeln('matrix');
for i:=1 to n do begin
for j:=1 to m do
write(a[i,j]:6:3);
writeln;
end;
writeln;
writeln('-------------------');
for i:=1 to n do begin
b[i]:=1;
for j:=1 to m do
if a[i,j]>x then b[i]:=0;
end;
writeln('vector');
for i:=1 to n do begin
write (b[i]:6:3);
writeln;
writeln('-------------------');
readln;
end;
Answer the question
In order to leave comments, you need to log in
is possible . but this will require a head * and hands **
* - knowledge of both languages (by eye *** - at least basic concepts)
** - you will have to type the translation with pens on the keyboard
*** - in terms of code level, even an online IDE is enough ** ** (this is the time to use Google)
ps for example https://ideone.com/ supports both languages, but it is unlikely to be convenient (at one point in time). you can use https://dotnetfiddle.net/ for sharp at the same time,
but something tells me that the choice is still larger ..
**** - IDEs are needed to run the code and compare the results (correct translation should give matching results, with matching input data)
In principle, it is possible to write a program in C# that will do the same thing as the code in the question.
If you want someone to do it for you, then refer to https://freelance.habr.com/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question