Найти суммы чисел в первом и последнем столбцах и сравнить их
Категория: Basic
2011-11-11 16:13:22
code: #basic
DATA 4,0,3,0,0,3,0,2,2,0,1,0,0,1,0,4 DIM a(4, 4) FOR i = 1 TO 4 FOR j = 1 TO 4 READ a(i, j) NEXT NEXT FOR i = 1 TO 4 FOR j = 1 TO 4 PRINT a(i, j); " "; NEXT PRINT NEXT FOR i = 1 TO 4 s1 = s1 + a(i, 1) s4 = s4 + a(i, 4) NEXT IF s1 > s4 THEN PRINT " summa 1 bolshe" ELSE IF s4 > s1 THEN PRINT "summa 4 bolshe" ELSE PRINT " summy ravny"
автор: кот Бегемот
Поделиться: