Texas Instruments TI-89 用户手册
![Texas Instruments](https://files.manualsbrain.com/attachments/b46f99d826b2b0e0e5f558c5fb6483942eb9216b/common/fit/150/50/c15ea36eb1fb1cce99a3b94668675bfc78ce832d8d727d9a7bb51a125510/brand_logo.gif)
Programming
639
Example 3
Example 3
Example 3
Example 3
This example uses
Dialog...EndDlog
to create dialog boxes for input and output. It uses
Loop...EndLoop
to calculate the result.
Ê
Defines a dialog box for input.
Ë
Converts string entered with Request to an expression.
Ì
Loop calculation.
Í
Defines a dialog box for output.
Ê
©
©
©
©
Ê
Ë
Ì
©
©
©
©
©
©
©
©
Ì
Í
©
©
©
©
Í
ê
:prog3()
:Prgm
:Dialog
: Title "Enter an integer"
: Request "Integer",n
:EndDlog
:expr(n)
!
n
:0
!
temp:0
!
I
:Loop
: temp+i
!
temp
: i+1
!
I
: If i>n
: Exit
:EndLoop
:Dialog
: Title "The answer is"
: Text string(temp)
:EndDlog
:EndPrgm