Var
a:integer;
begin
Read(a);
if (a < 18) then Writeln('Вы не совершеннолетний')
else Writeln('Вы совершеннолетний')
end.
Ответ:
def find_uncommon(*args):
uncommon_arg = None
uncommon_index = None
for item in args:
if args.count(item) == 1:
uncommon_arg = item
uncommon_index = args.index(item)
else:
continue
return (uncommon_arg, uncommon_index)
def main():
nums = [int(i) for i in input().split()]
uncommon_info = find_uncommon(*nums)
print(
'not common number is {0}, staying on {1} ({2} for normal people) position in input list'.format(uncommon_info[0], uncommon_info[1], uncommon_info[1]+1)
)
if __name__ == '__main__':
main()
input()
Объяснение:
Программа более менее протестирована, делает вид что работает так, как должно. Единственное - программа выводит более обширную информацию об искомом числе, нежели указано в задании. Копировать отсюда не советую, Python-код "знания" нещадно ломают. Вы можете восстановить код по скриншоту самостоятельно, или попросите в комментариях, я залью этот код на pastebin.com и дам вам ссылку
Первый вариант:
Var
a,b:real;
Begin
Write('Введите два числа: ');ReadLn(a,b);
if a>b then Write(a-b)
else Write(b-a)
End.
Второй вариант:
Var a,b:real;
Begin
Write('Введите два числа: ');ReadLn(a,b);
WriteLn(Abs(a-b))
End.
Const
n = 10;
var
a: array[1..n] of integer;
j, s: integer;
begin
s := 0;
for j := 1 to n do
begin
read(a[j]);
if a[j] > 5 then inc(s, a[j]);
end;
writeln(s);
readln;
<span>end.</span>