Построить круговую диаграмму — QBasic(Бейсик)

N — количество чисел.
Дальше ввод самих чисел.

INPUT n
DIM a(n)
CONST pi2 = 6.28318531#
proc1 = pi2 / 100
FOR i = 1 TO n
        INPUT a(i)
        s = s + a(i)
NEXT i
FOR i = 1 TO n
        a(i) = (a(i) * 100) / s
                PRINT a(i)
NEXT i
 
clr = 1
SCREEN 12
FOR i = 1 TO n
        clr = clr + 1
        st = st + (pi2 / 100) * a(i)
        DO WHILE u < st
                u = u + .01
                FOR j = 1 TO 50
                        PSET (160 + SIN(u) * j, 100 - COS(u) * j), clr
                NEXT j
        LOOP
        COLOR clr
        PRINT a(i); "%"       
NEXT
COLOR 15