Hi! błąd wykonania (NZEC) Chyba podaje wyniki dobrze, nie wiem czy to nie problem z zatrzymaniem pętli.
W c++ się chyba dało zrobić while input czy coś podobnego.
tab = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
while True:
x = input()
x = x.split()
a = x[0] #z
b = int(x[1]) #3
c = int(x[2]) #6
if a == 'z':
tab[b] = c
x = tab[b]
elif a == '+':
c = tab[b] + tab[c]
print(int(c))
elif a == '-':
c = tab[b] - tab[c]
print(int(c))
elif a == '*':
c = tab[b] * tab[c]
print(int(c))
elif a == '/':
c = tab[b] / tab[c]
print(int(c))
elif a == '%':
c = tab[b] % tab[c]
print(int(c))
created
last reply
- 4
replies
- 777
views
- 2
users
- 1
like
- 2
links