1153:0 start-up algorithm 60--element forward 1 bit

Source: Internet
Author: User

1153:0 start-up algorithm 60--element forward 1-bit time limit:1 Sec Memory limit:64 MB 64bit IO Format:%lld
submitted:859 accepted:574
[Submit] [Status] [Web Board] Description

Moves the array all elements forward one (the first element moves to the last) and then outputs the moved array

Input

Multiple sets of test data, each set
The first line enters an integer n (not greater than 20)
Enter n integers in the second line

Output

An array that moves forward one after the output

Sample Input
41 2 3 4

Sample Output
2 3 4 1

Source

0 Starting point Learning algorithm

1#include <stdio.h>2 intMain () {3     intn,a[ -],b[ -];4      while(SCANF ("%d", &n)! =EOF) {5          for(intI=0; i<n;i++){6scanf"%d",&A[i]); 7         }8     9      for(intI=1; i<n;i++){Tenb[i-1]=A[i]; One     } Ab[n-1]=a[0]; -      -      for(intI=0; i<n-1; i++){ theprintf"%d", B[i]);  -     } -printf"%d\n", b[n-1]); -     } +     return 0; -}

1153:0 start-up algorithm 60--element forward 1 bit

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.