<u>PascalABC.NET 3.3.5, сборка 1650 от 01.04.2018</u>
<u>Внимание! Если программа не работает, обновите версию!</u>
begin
var a:=ArrRandom(10,-50,50); a.Println;
Writeln('s5=',a[:5].Sum)
end.
<u>Пример</u>
-8 -42 14 -25 27 5 34 37 -24 24
s5=-34
Перепроверь массив и скомпилируй.
// Example program#include <iostream>#include <string>
using namespace std;
int count_;const unsigned int DIM1 = 6;const unsigned int DIM2 = 6;int m[DIM1][DIM2] = { { 'S', '.', '.', '.', '#', '#' }, { '#', '.', '#', '.', '.', '.' }, { '.', '.', '#', '.', '.', '#' }, { '.', '.', '#', '#', '#', '.' }, { '#', '.', '.', '.', '#', '#' }, { '#', '#', '#', '.', '.', 'F' }};int find_p(int x, int y) { if (x < 0 || x > 5 || y < 0 || y > 5) return 0; if (m[y] [x] == 'F') return 1; if (m[y] [x] != '.' && m[y] [x] != 'S') return 0; m[y] [x] = '+'; count_++; if (find_p (x, y - 1)) return 1; if (find_p (x + 1, y)) return 1; if (find_p (x, y + 1)) return 1; if (find_p (x - 1, y)) return 1; m[y] [x] = 'x'; return 0;}int main(){ find_p(0, 0); cout<<"\n Otvet="<<count_;}
Вот код:
n, m = int(input()), int(input())
n += m
s1, s2 = set(), set()
for i in range(n):
student = (input())
if student in s1:
s1.remove(student)
s2.add(student)
else:
s1.add(student)
if len(s1) <= 0:
print('NO')
else:
print(len(s1))
Вот ссылка на код с отступами:https://pastebin.com/Ud5AwrSs