daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest May 17th, 2018 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. typedef struct{
  2.     int krug;
  3.     int ime;
  4. }formula;
  5. void pretekni(formula p[], int n, int size){
  6.     formula tmp;
  7.     for(int i = 0; i < size; i++){
  8.         if(p[0].ime == n){
  9.             tmp = p[0].ime;
  10.             p[0].ime = p[size-1].ime;
  11.             p[size-1].ime = tmp;
  12.             for(int j = 0; j < size-1; j++){
  13.                 tmp = p[j].ime;
  14.                 p[j].ime = p[j+1].ime;
  15.                 p[j+1].ime = tmp;
  16.             }
  17.         }
  18.  
  19.         if(p[i].ime == n){
  20.             tmp = p[i].ime;
  21.             p[i].ime = p[i-1].ime;
  22.             p[i-1].ime = tmp;
  23.         }
  24.     }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top