牛客刷题篇

1. 计算体重指数 00:00:00⸺00 :10:34题号:(⽆) 链接: https://www.nowcoder.com/que
stionTerminal/422f6341cf1b4212a7f8c703df111389
#include <iostream>
using namespace std;

int main() {
   int tz,sg;
   cin>>tz>>sg;
   double ret=tz*1.0/(sg*sg)*10000;
   printf("%.2lf",ret);
}

2. 计算三⻆形的周⻓和⾯积 00:10:34⸺00 :20:35题号:BC34 链接: https://www.nowcode
r.com/practice/109a44d649a142d483314e8a57e2c710?tpId=290&tqId=39822&ru=/exam/oj
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a ,b ,c ;
    cin>>a>>b>>c;
    double circ=a+b+c;
    double cir=circ/2.0;
    double area=sqrt(cir*(cir-a)*(cir-b)*(cir-c));
    printf("circumference=%.2lf area=%.2lf",circ,area);
}

3. 计算球体的体积00:20:35⸺00:30:49 题号:(⽆)链接: https://www.nowcoder.com/qu
estionTerminal/0f5d9bfcd63b47fda2052a583b1fbd1f
#include<bits/stdc++.h>
using namespace std;
int main()
{
    double pi=3.1415926;
    double r;
    cin>>r;
    double V=4/3.0*pi*pow(r,3);
    printf("%.3lf",V);
}

4. 成绩的输⼊输出00:30:49⸺00: 38:50题号:BC11 链接: https://www.nowcoder.com/pract
ice/eb49750ef0de47168c21761de086d97c?tpId=290&tqId=39799&ru=/exam/oj
#include<bits/stdc++.h>
int main()
{
    int s1,s2,s3;
    scanf("%d%d%d",&s1,&s2,&s3);
    printf("score1=%d,score2=%d,score3=%d",s1,s2,s3);
}

5. 变种⽔仙花数00:38:50⸺00 :48:55题号:BC92 链接: https://www.nowcoder.com/practice/
c178e3f5cc4641dfbc8b020ae79e2b71?tpId=290&tqId=39880&ru=/exam/oj
#include<bits/stdc++.h>
using namespace std;
int main()
{
    for(int i=10000;i<=99999;i++)
    {
        int sum=0;
        for(int j=10;j<=10000;j=j*10)
        {
            sum=sum+(i%j)*(i/j);
        }
        if(i==sum)
        {
            cout<<sum<<" ";
        }
    }
}

6. KIKI算数00:48:55⸺01:07:42 题号:BC49 链接: https://www.nowcoder.com/practice/b
caf710fb58a44e1b678a890e6e90d7c?tpId=290&tqId=39837&ru=/exam/oj
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    if(a>=100)
    {
        a=a%100;
    }
    if(b>=100)
    {
        b=b%100;
    }

    int ret=a+b;
    if(ret>=100)
    {
        ret=ret%100;
    }
    cout<<ret;
}

7. 浮点数的个位数字01:08:25⸺01:12:53题号:BC24 链接: https://www.nowcoder.com/p
ractice/ffa94d27c6534396aef38813535c279f?tpId=290&tqId=39812&ru=/exam/oj
#include<bits/stdc++.h>
using namespace std;
int main()
{
    double a;
    cin>>a;
    int ret=(int)a%10;
    
    cout<<ret;

}

 

8. 你能活多少秒?01:12:53⸺01:19:28题号:BC32 链接: https://www.nowcoder.com/pra
ctice/e1d1bd99fee34b66ae3c777b74d555c8?tpId=290&tqId=39820&ru=/exam/oj
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long ret;
    int a;
    cin>>a;
    ret=a*3.156*pow(10,7);
    cout<<ret;
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值