Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. void numar(int n,  int a[], int& k)
  2.  
  3. {
  4.  
  5.   int min=a[0], max=a[0], i;
  6.  
  7.   for (i=1; i<n; ++i){
  8.  
  9.        if (a[i]<min) min=a[i];
  10.  
  11.        if (a[i]>max) max=a[i];
  12.  
  13.   }
  14.  
  15.   int copiemin=min, z=1;
  16.  
  17.   while (copiemin>0) {
  18.  
  19.       z*=10; copiemin /=10;
  20.  
  21.   }
  22.  
  23.   k=max*z+min;
  24.  
  25.   return;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement