第8题和13题通不过,求教。
查看原帖
第8题和13题通不过,求教。
345095
fhzzxxx楼主2020/5/17 21:14
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main() {
	int t;
	double p;
		p=3.141593;
	cin>>t;
	switch(t) {
		case 1:
			cout<<"I love Luogu!";break;
		case 2:
			cout<<2+4<<" "<<10-2-4<<endl;break;
		case 3:
			cout<<3<<endl<<4*3<<endl<<14-4*3<<endl;break;
		case 4:
			printf("%6.3f\n",0.1*5000/3);break;
		case 5:
			cout<<(260+220)/(12+20)<<endl;break;
		case 6:
			cout<<sqrt(6*6+9*9)<<endl;break;
		case 7:
			int n;
			n=100+10;
			printf("%d\n",n);
			n=n-20;
			printf("%d\n",n);
			n=0;
			printf("%d",n);break;
		case 8:
			cout<<2*5*p<<endl;
			cout<<p*5*5<<endl;
			cout<<4.0/3*p*5*5*5<<endl;
			break;
		case 9:
			int a;
			a=1;
			a=(a+1)*2;
			a=(a+1)*2;
			a=(a+1)*2;
			cout<<a<<endl;break;
		case 10:
			cout<<9<<endl;break;
		case 11:
			cout<<1.0*100/(8-5);break;
		case 12:
			char b;int k;
			k=1;
			b='A';
			while(b!='M') {b++;  k++;
			}
			cout<<k<<endl;
			b='A';
			for(int i=1;i<18;i++) b++;
			cout<<b;
			break;
		case 13:
			double v1;
			v1=4/3*p*(4*4*4+10*10*10);
			v1=pow(v1,1.0/3);
			cout<<(int)v1;
			break;
		case 14:
			int x;
			for(int i=1;i<=110;i++){
				x=i*(10+110-i);
				if(x==3500) {
					cout<<i;return 0;
				}
			}
			break;
		default :
			cout<<"error";
	}
	return 0;
}
2020/5/17 21:14
加载中...