HDU 2148 Score

http://acm.hdu.edu.cn/showproblem.php?pid=2148

View Code
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
    int t,n,l;
    int i;
    int s[1100];
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d%d",&n,&l);
        for(i=1;i<=n;i++)
            scanf("%d",s+i);
        int ans=0;
        for(i=1;i<=n;i++)
            if(s[i]>s[l])
                ans++;
        printf("%d\n",ans);
    }
    return 0;
}
原文地址:https://www.cnblogs.com/xiaohongmao/p/2457268.html