bool loop = true;
int count = 0;
int sum = 0;
while (loop){
int i = Convert.ToInt32(Console.ReadLine());
sum += i;
count++;
if (i == 0){
loop = false;
Console.WriteLine(sum);
Console.WriteLine(sum/count);
}
}
Лови
#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin >> n;
int tmp, t = 0;
tmp = n;
while (tmp > 0) {
t *= 10;
t += tmp%10;
tmp /= 10;
}
if (t == n) cout << "YES\n";
else cout << "NO\n";
}
Program task;
var i,a,b,h:longint;
begin
writeln('a?');
readln(a);
writeln('b?');
readln(b);
writeln('h?');
readln(h);
i:=a;
while (i<=b) do begin
writeln(sin(i)*sin(i));
i+=h;
end;
readln;
end.
количество возможных вариантов N в степени 10
Function f(n:integer):boolean;
var m:set of 0..9;
begin
m:=[];
f:=true;
while n>0 do
begin
if (n mod 10) in m then f:=false;
m:=m+[n mod 10];
n:=n div 10;
end;
end;
begin
writeln(f(12321));
end.
Результат:
<span>False</span>