Rokua-Small fish number game-array

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.