Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Define an integer array a[ 100], and how to enter any number at will (note: you don't know if you enter it at will).
Define an integer array a[ 100], and how to enter any number at will (note: you don't know if you enter it at will).
for(int I = 0; I< 100; ++i)

{

scanf("%d ",& ampa[I]);

if(getchar()=='\n ')

Break;

}

In this way, you can store the input numbers into the array one by one. After typing enter \n, it means that the input is over (it can also be changed to something else). After that, the value of i+ 1 is the number you enter.