Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- using namespace std;
- int main() {
- int n;
- scanf("%d", &n);
- int lista[60060];
- for (int i = 0; i < n; i++) {
- scanf("%d", &lista[i]);
- }
- int resposta = 0;
- for (int i = 0; i < n; i++){
- for (int j = i+1; j < n; j++) {
- if (lista[j] < lista[i]) {
- resposta++;
- }
- }
- }
- printf("%d\n", resposta);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement