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. while(t!=0)
  12. {
  13. count=0;
  14. scanf("%d", &n);
  15. int ar[n];
  16.  
  17. for(i=0;i<n;i++)
  18. scanf("%d", &ar[i]);
  19.  
  20. printf("\n");
  21.  
  22. for(i=0;i<n-1;i++)
  23. {
  24. for(j=i+1;j<n;j++)
  25. {
  26. if(ar[i]>ar[j])
  27. {
  28. count+=1;
  29. }
  30. }
  31. }
  32. ans[t]=count;
  33. t--;
  34. }
  35.  
  36. for(i=0;i<temp;i++)
  37. printf("%d\n",ans[i]);
  38.  
  39. getch();
  40. return 0;
  41. }
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:39: warning: implicit declaration of function ‘getch’
prog.c:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
prog.c:14: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
prog.c:18: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
stdout
Standard output is empty