Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int n,k,niza[100],ctr=0,brojnizi;
- scanf("%d",&brojnizi);
- for(int i=0;i<brojnizi;i++)
- {
- scanf("%d",&n);
- for(int j=0;j<n;j++)
- {
- scanf("%d",&niza[j]);
- }
- for(int j=0;j<n;j++)
- {
- if(niza[j]==niza[n-j-1])
- {
- ctr++;
- }
- }
- printf("%.2f%\n",(float)ctr/n*100);
- ctr=0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment