mirror of
https://github.com/KarolS/millfork.git
synced 2024-11-05 00:05:44 +00:00
32 lines
568 B
Plaintext
32 lines
568 B
Plaintext
import stdio
|
|
import c64_basic
|
|
|
|
array text1 = [ "enter first number:", 13, 0 ]
|
|
array text2 = [ "enter second number:", 13, 0 ]
|
|
array text3 = [ "the sum is:", 13, 0 ]
|
|
array texte = [ "that wasn't a number, try again:", 13, 0 ]
|
|
|
|
void main() {
|
|
word a
|
|
word b
|
|
|
|
putstrz(text1)
|
|
a = readword()
|
|
while readword_err != 0 {
|
|
putstrz(texte)
|
|
a = readword()
|
|
}
|
|
|
|
putstrz(text2)
|
|
b = readword()
|
|
while readword_err != 0 {
|
|
putstrz(texte)
|
|
b = readword()
|
|
}
|
|
|
|
putstrz(text3)
|
|
a += b
|
|
putword(a)
|
|
putchar(13)
|
|
}
|