fork download
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. int main()
  5. {
  6. int t, n, i, j, count;
  7. scanf("%d", &t);
  8. int temp=t;
  9. int ans[t];
  10. printf("\n");
  11. t--;
  12. while(t!=0)
  13. {
  14. count=0;
  15. scanf("%d", &n);
  16. int ar[n];
  17.  
  18. for(i=0;i<n;i++)
  19. scanf("%d", &ar[i]);
  20.  
  21. printf("\n");
  22.  
  23. for(i=0;i<n-1;i++)
  24. {
  25. for(j=i+1;j<n;j++)
  26. {
  27. if(ar[i]>ar[j])
  28. {
  29. count+=1;
  30. }
  31. }
  32. }
  33. ans[t]=count;
  34. t--;
  35. }
  36.  
  37. for(i=0;i<temp;i++)
  38. printf("%d\n",ans[i]);
  39.  
  40. getch();
  41. return 0;
  42. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2

3
3
1
2

5
2
3
8
6
1
compilation info
prog.c:2:18: error: conio.h: No such file or directory
prog.c: In function ‘main’:
prog.c:40: warning: implicit declaration of function ‘getch’
prog.c:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
prog.c:15: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
prog.c:19: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
stdout
Standard output is empty