Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int B, N[100000], x, count=0, count2=0, y;
- scanf("%d", &B);
- if(B>(pow(10,4))) return 0;
- for(x=0; x<B; x++) {
- scanf("%d", &N[x]);
- }
- for(x=0; x<B; x++) {
- for(y=x+1; y<B; y++) {
- if(N[x] > N[y]) count++;
- } }
- printf("%d", count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement