Title DescriptionDescription Small fish was recently asked to participate in a number game, requiring it to see a number of numbers (not necessarily, the length of the 0 end, up to 100), remember and then read it back (meaning the end of the number 0 do not read it out). This is very difficult for the little fish memory, you do not want to think of the whole head of small fish is how big, part of it is delicious meat! So please help the small Fish program to solve this problem.
input/output format input/output
Input Format:
Enter a string of integers in a row, ending with a space interval of 0.
output Format:
Output this string of integers in a row, with a space interval.
input and Output sample sample Input/output
sample Test point # #
Input Sample:3 65 23 5 34 1 30 0
Sample output:
1 5 3
idea: The non-zero number into the array, reverse output can be.
The code is as follows:
1#include <stdio.h>2 intMain ()3 {4 inta[ -];5 intI=0, B,j;6scanf"%d",&b);7 while(b!=0)//Non-0 deposit array8 { 9 if(b!=0)Ten { Onea[i]=b; Ai++; - } -scanf"%d",&b); the } - for(j=i-1; j>=0; j--)//output can - { -printf"%d", A[j]); + } -printf"\ n"); + return 0; A}
Rokua-Small fish number game-array