⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1a1.cpp

📁 toj1412
💻 CPP
字号:
#include<iostream>
#include<iomanip>

using namespace std;

int main()
{
	int cases;
	cin>>cases;
	while(cases--)
	{
		int studentno;
		cin>>studentno;
		int score[1001];
	    for(int i=1;i<=studentno;i++)
		{
			int temp;
			cin>>temp;
			score[i]=temp;
		}
		double total(0.0);
	    for(int i=1;i<=studentno;i++)
		{
			total=total+score[i];
        }
        double ave;
        ave=total/studentno;
        int goodno(0);
        for(int i=1;i<=studentno;i++)
        {
                if(score[i]>ave)
                {goodno++;}
        }
        double goodrat;
        goodrat=double(goodno)/double(studentno)*100;
        cout<<setprecision(3)<<fixed<<goodrat<<"%"<<endl;
  }


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -