SHARE
TWEET

Untitled

funAlways Nov 15th, 2017 58 in 3 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4. #include <stdlib.h>
  5.  
  6. int main()
  7. {
  8.     int size, rot, pos, input[2000], result[2000], x, i;
  9.     scanf("%d %d %d", &size, &rot, &pos);
  10.     for(x=0;x<size;x++)
  11.     {
  12.         scanf("%d", &input[x]);
  13.     }
  14.     for(x=0, i=rot%size;x<size;x++, i++)
  15.     {
  16.         if(i>=size)
  17.         {
  18.             i=0;
  19.         }
  20.         result[i] = input[x];
  21.  
  22.     }
  23.     printf("%d", result[pos]);
  24.  
  25.  
  26. }
RAW Paste Data
Top