1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
void main() { int num; printf("Enter a number: \n"); scanf("%d", &num); if (num > 0) printf("%d is a positive number \n", num); else if (num < 0) printf("%d is a negative number \n", num); else printf("0 is neither positive nor negative"); } |
结果
1 2 3 |
Enter a number: -3 -3 is a negative number |
相关文章:
除教程外,本网站大部分文章来自互联网,如果有内容冒犯到你,请联系我们删除!