SHARE
TWEET

TOP3_3

Abaduaber Apr 14th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CLS
  2. CONST ArrayLimit = 1000
  3. DIM A(1 TO ArrayLimit) AS INTEGER
  4. DIM AI AS INTEGER, Limit AS INTEGER
  5. AI = 0
  6. PRINT "Введите последовательность целых чисел. Завершить ввод можно, введя 0."
  7. DO
  8.     AI = AI + 1
  9.     IF AI > ArrayLimit THEN
  10.         PRINT "Кажется, вы упоролись"
  11.         END
  12.     END IF
  13.     PRINT "A("; AI; ") = ";
  14.     INPUT "", A(AI)
  15. LOOP UNTIL A(AI) = 0
  16. Limit = AI - 1
  17. DIM Counter AS INTEGER
  18. 'Ноль не учитывается! В условии неясно, следует ли его учитывать
  19. FOR AI = 1 TO Limit - 1
  20.     IF A(AI) < A(AI + 1) THEN Counter = Counter + 1
  21. NEXT AI
  22. PRINT "Число элементов массива, чье значение < значения следующего элемента:"; Counter
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top