ПЕРВАЯ ПРОГРАММА using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace Factorial { class Program {
static void Main(string[] args) { string str = ""; Console.WriteLine("Vvestu n:"); str = Console.ReadLine(); int n = Convert.ToInt32(str); Console.WriteLine(Enumerable.Range(1, n).Aggregate((p, x) => p * x)); Console.ReadKey(); } } }
Вторая программа (поменяй путь на свой!) using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace Open { class Program { static void Main(string[] args) { System.Diagnostics.Process.Start(@"T:\Program Files\Projects\Lessons\Factorial\Factorial\bin\Debug\Factorial.exe"); } } }
Const n = 50; // количество чиселvar k: array [1..n] of integer; i, j, n1, n2, minr, a, b: integer; begin writeln(n, ' ', ': d'); a : = random(1000); b : = random(1000); minr : = 10000; for i : = 1 to n do k[i] : = a + random(b); for i : = 1 to n do for j : = 1 to n do if ((abs(k[i] - k[j])) < minr) and (k[i] < > k[j]) then begin minr : = abs(k[i] - k[j]); n1 : = i; n2 : = j; end; writeln(n1, ' ', n2); end.
1. Блок ветвления(ромб) имеет два выхода, один для истинного значения, другой для ложного
2. Блок операций
3. Межстраничный соединитель
1. a:=5
2. {*текст*}
3. условие
В практике не совсем понял, что требуется, так что просто написал программу
program m1;
var F,b,a,c:integer;
begin
read(a,b);
F:=b*b - a*a;
if F<0 then
c:=b
else
c:=a;
writeln(c);
end.