本地样例未过求助
查看原帖
本地样例未过求助
662037
_Jonny_404楼主2023/1/3 21:01
#include<cstdio>
#include<math.h>
#include<iomanip>
#include<iostream>
using namespace std;

int n;
char c1[5],c2[5];

int main()
{
	scanf("%d%s=?%s",&n,c1,c2);
	cout<<n<<" "<<c1<<" "<<c2<<endl;
	if(c1+1=="B"&&c2+1=="KB")
		printf("%.2lf",n*pow(2,10));
	if(c1+1=="B"&&c2+1=="MB")
		printf("%.2lf",n*pow(2,10)*pow(2,10));
	if(c1+1=="B"&&c2+1=="GB")
		printf("%.2lf",n*pow(2,10)*pow(2,10)*pow(2,10));
	if(c1+1=="KB"&&c2+1=="B")
		printf("%.2lf",n/pow(2,10));
	if(c1+1=="KB"&&c2+1=="MB")
		printf("%.2lf",n*pow(2,10));
	if(c1+1=="KB"&&c2+1=="GB")
		printf("%.2lf",n*pow(2,10)*pow(2,10));
	if(c1+1=="MB"&&c2+1=="B")
		printf("%.2lf",n/pow(2,10)/pow(2,10));
	if(c1+1=="MB"&&c2+1=="KB")
		printf("%.2lf",n/pow(2,10));
	if(c1+1=="MB"&&c2+1=="GB")
		printf("%.2lf",n*pow(2,10));
	if(c1+1=="GB"&&c2+1=="B")
		printf("%.2lf",n/pow(2,10)/pow(2,10)/pow(2,10));
	if(c1+1=="GB"&&c2+1=="KB")
		printf("%.2lf",n/pow(2,10)/pow(2,10));
	if(c1+1=="GB"&&c2+1=="MB")
		printf("%.2lf",n/pow(2,10));
	return 0;
}

一天连发22个求助帖我是屑

2023/1/3 21:01
加载中...