int main () { int curnum =0; //这次输入的数字 int allnum [10]; //保存输入的数字 int numoff =0; // 保存的数字的个数 while (true) { printf ("Input a number, type 0 to stop and out put all numbers \n"); scanf ("%d",&curnum); if (curnum == 0) { printf ("you typed 0, it's over \n"); break; } if (numoff > 9){ printf ("you typed more then 10 numbers, it's over \n"); break; } allnum[numoff++] = curnum; } printf ("now we will out put all numbers you typed \n"); for (int i = 0; i < numoff; i++) printf ("%d \n",allnum[i]); return 0; }