标签:输入 main 习题 ffffff .com return code 面积 苹果
习题评测地址:http://ybt.ssoier.cn:8088
计算两个双精度浮点数a和b的相除的余数,a和b都是正数的。这里余数(r)的定义是:a = k * b + r,其中 k是整数, 0 <= r < b。
输入仅一行,包括两个双精度浮点数a和b。
输出也仅一行,a÷b的余数。
73.263 0.9973
0.4601
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
double a,b;
cin>>a>>b;
printf("%g",a-b*int(a/b));
return 0;
}
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
const double PI = 3.14;
double r;
cin>>r;
printf("%.2lf\n",4/3.0*PI*r*r*r);
return 0;
}
#include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
int a,b,c;
a=n/100;
b=n%100/10;
c=n%100%10;
cout<<c<<b<<a<<endl;
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main(){
const double PI=3.1415926;
int h,r; // h深 r:半径
int l = 20000;
int s; //输出值
cin>>h>>r;
double v = PI*r*r*h;
s=ceil(l/v);
cout<<s<<endl;
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main(){
double xa,ya,xb,yb;
cin>>xa>>ya>>xb>>yb;
printf("%.3lf",sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)));
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main(){
double x1,y1,x2,y2,x3,y3,s,p,l1,l2,l3;
cin>>x1>>y1>>x2>>y2>>x3>>y3;
l1=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
l2=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
l3=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
p=(l1+l2+l3)/2.0;
printf("%.2lf",sqrt(p*(p-l1)*(p-l2)*(p-l3)));
return 0;
}
#include <iostream>
using namespace std;
int main(){
long long a,b,c;
cin>>a>>b;
c=a*b;
cout<<c<<endl;
return 0;
}
#include <iostream>
using namespace std;
int main(){
long n;
cin>>n;
cout<<(1<<n)<<endl;
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int n;
float x,y;
cin>>n>>x>>y;
cout<<n-ceil(y/x)<<endl;
return 0;
}
标签:输入 main 习题 ffffff .com return code 面积 苹果
原文地址:https://blog.51cto.com/imentors/2360063