试题连接:
#include#include #include using namespace std;float r[600];bool cmp(float a,float b){ return a>b;}float f(float r){ return sqrt(r*r-1*1);}int main(){ int cnt; cin>>cnt; while(cnt--) { int n; cin>>n; for(int i=0; i >r[i]; sort(r,r+n,cmp); float len=0; int i=0; while(len<20) { len+=2*f(r[i]); i++; } cout< <