供参考:
#include<stdio.h>
int main()
{
int x, y;
printf("请输入一个数字:");
while (scanf("%d", &x) == 1 && x != 0)
{
if (x > 0) {
if (x < 10)
y = x + 1;
if (x >= 10)
y = x % 3;
printf("y=%d\n", y);
}
else
printf("y=4\n");
printf("请继续输入一个数字【当输入‘0’时,结束输入】:");
}
re