-->
当前位置:首页 > 题库

PROGRAMMING:4.1 - judge the sign of an integer and execute it circularly

Luz5年前 (2021-05-10)题库425
Code listing 3 - 9 is a program to determine the sign of the integer value entered, but it quits once
Please rewrite it to be executed for countless times. After each execution, you can continue the loop until you enter the integer 0!
-----From exercise 4-1
Examples are as follows:
```
Please enter an integer: 35
The integer is positive.
Please enter an integer: - 4
The integer is negative.
Please enter an integer: - 2098
The integer is negative.
Please enter an integer: 0
The integer is 0.
```
###Input example:
```in
thirty-five
-4
two hundred and eighty-seven
-876
0
```
###Output example:
```out
Please enter an integer: the integer is positive.
Please enter an integer: the integer is negative.
Please enter an integer: the integer is positive.
Please enter an integer: the integer is negative.
Please enter an integer: the integer is 0.
```







answer:If there is no answer, please comment