Advertisement
BORUTO-121

sortByPhoneNumber

Sep 10th, 2021
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. struct Grad{
  4.   char naziv[20];
  5.   int pozivni_broj;
  6. };
  7.  
  8. void preslozi_pozivni(struct Grad *niz, int vel, int tel){
  9.   int i,zadnji_preslozeni=0;
  10.   for(i=0;i<vel;i++){
  11.     if(niz[i].pozivni_broj==tel){
  12.       struct Grad zapamti=niz[i];
  13.       int j;
  14.       for(j=i;j>zadnji_preslozeni;j--)
  15.         niz[j]=niz[j-1];
  16.       niz[zadnji_preslozeni]=zapamti;
  17.       zadnji_preslozeni++;
  18.     }
  19.   }
  20. }
  21.  
  22. int main(){
  23.  
  24.    return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement