Use namespace std
void main()
{
int a[ 100];
int I;
int t;
for(I = 0; I & lt=99; )
{
if((int)(a[i]=getchar())! =32)
{
i++;
t = I;
}
other
Break;
}
Printf ("The valid number entered is:");
for(I = 0; I<= t;; i++)
printf("%c ",a[I]);
}
When I enter the data test, I press Enter every time I enter a data (whether I enter a character or a number).
That is, press enter to distinguish the characters you entered. When you want to end the assignment, just enter a space and press Enter.
I added an extra input number before the output space myself. If there is anything wrong, please tell me.