ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#171346 | #973. 正圆也能做排序 | heyuzhen | 100 | 0ms | 1352kb | C++ | 603b | 2023-06-22 21:50:49 | 2023-06-22 21:50:51 |
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dou double
struct node{
string m;
ll b;
double c,s;
void check(){
c = 6.28 * b;
s = 3.14 * b * b;
}
bool operator < (const node t) const{
return m < t.m;
}
void print(){
cout << m << " " << b << " ";
printf("%.1f %.1f",c,s);
cout << endl;
}
}a[1005];
ll n;
int main(){
// freopen("data01.txt","r",stdin);
cin >> n;
for(ll i = 1;i <= n;i++){
cin >> a[i].m >>a[i].b;
a[i].check();
}
sort(a + 1,a + n + 1);
for(ll i = 1;i <= n;i++)
a[i].print();
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 33
Accepted
time: 0ms
memory: 1340kb
input:
3 c1 3 c2 5 c3 3
output:
c1 3 18.8 28.3 c2 5 31.4 78.5 c3 3 18.8 28.3
result:
ok 3 lines
Test #2:
score: 33
Accepted
time: 0ms
memory: 1340kb
input:
5 x 5 a 4 c 2 z 3 b 3
output:
a 4 25.1 50.2 b 3 18.8 28.3 c 2 12.6 12.6 x 5 31.4 78.5 z 3 18.8 28.3
result:
ok 5 lines
Test #3:
score: 33
Accepted
time: 0ms
memory: 1352kb
input:
3 abd 4 bda 5 abc 3
output:
abc 3 18.8 28.3 abd 4 25.1 50.2 bda 5 31.4 78.5
result:
ok 3 lines