CSP_AK_xyy20110721 @ 2022-07-29 16:08:06
#include<iostream>
#include<cmath>
using namespace std;
int main() {
//#8#13WA,得分86
int T;
cin >> T;
switch(T){
case 1:cout << "I love Luogu!";break;
case 2:cout << 2 + 4 << " " << 10 - 2 - 4;break;
case 3:cout<<14/4<<endl<<12<<endl<<2;break;
case 4:printf("%.3f",500.0/3);break;
case 5:cout<<(260+220)/(20+12);break;
case 6:cout<<sqrt(6*6+9*9);break;
case 7:cout<<110<<endl<<90<<endl<<0<<endl;break;
case 8:cout<<31.41593<<endl<<3.141593*25<<endl<<4/3*3.141593*125;break;
case 9:cout<<(((1+1)*2+1)*2+1)*2;break;
case 10:cout<<9;break;
case 11:cout<<1.0*100/3;break;
case 12:cout<<13<<endl<<'R';break;
case 13:cout<<(int)(pow(4/3*3.141593*(4*4*4+10*10*10),1.0*1/3));break;
case 14:cout<<50;break;
}
return 0;
}
by JustinXiaoJunyang @ 2022-07-29 16:20:57
@xyy20110721 求关注~
第 8 问:
case 8:
{
cout << PI * 10 << endl;
cout << PI * 25 << endl;
cout << 4 * PI * 125 / 3.0;
break;
}
其中 PI 是常数。
第 13 问:
case 13:
{
double V1 = 4 * PI * 64 / 3.0, V2 = 4 * PI * 1000 / 3.0;
cout << (int)pow(V1 + V2, 1 / 3.0);
break;
}
by irris @ 2022-07-29 16:27:36
@xyy20110721 在 cpp 中,4/3
默认为 int / int 会执行整除操作,所以会变成
by irris @ 2022-07-29 16:28:44
还有实名反对一楼这个东西复制个代码还好意思求关注。
by CSP_AK_xyy20110721 @ 2022-07-30 11:39:03
@JustinXiaoJunyang 你也关注下我呗
by CSP_AK_xyy20110721 @ 2022-07-30 11:39:31
@AlgorithmerSnow 好像是
by CSP_AK_xyy20110721 @ 2022-07-30 11:42:22
@JustinXiaoJunyang @AlgorithmerSnow 谢了