1 2 3 4 5 6 7 8 9 10 11 12 13 14 | input n dim a(n) for i= 1 to n input"vvedite element ",a(i) next print "massiv" for i= 1 to n print a(i); next print for i= 1 to n if i=a(i) then s=s+a(i) next print s |
Тестирование выполнено в программе QB64 ( Скачать )