Pascal: var count: integer; n: real; begin write ('n = '); readln(n); count: =0; while n> =10 do begin n: =n/12; inc(count); end; write ('kol-vo: ',count); readln; end. c++: #include < iostream> using namespace std; int main() { float n; int count = 0; cout < < "n = "; cin > > n; while (n> =10) { n/=12; ++count; } cout < < "kol-vo: " < < count < < endl; return 0; }
Семеновна-Павел
10.06.2021
Var n, i, number: integer; begin readln(n); number : = 1; {т.к. само число является своим делителем} for i : = 1 to n div 2 do {т.к. делителей больше половины чила ровно} begin {один, который мы уже учли} if n mod i = 0 then number : = number + 1; end; writeln(number); end.
frolevgevg6420
10.06.2021
Первая программа 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"); } } }