Advertisement
Raul_julian

Balé-[OBI]

Jun 17th, 2013
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6.     int B, N[100000], x, count=0, count2=0, y;
  7.  
  8.     scanf("%d", &B);
  9.  
  10.         if(B>(pow(10,4))) return 0;
  11.         for(x=0; x<B; x++) {
  12.  
  13.         scanf("%d", &N[x]);  
  14.                     }
  15.  
  16.         for(x=0; x<B; x++) {
  17.    
  18.         for(y=x+1; y<B; y++) {
  19.  
  20.         if(N[x] > N[y]) count++;
  21.                         } }
  22.  
  23.     printf("%d", count);
  24.  
  25. return 0;  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement