C++在线一本通1006~1023题答案(其中1011暂时缺少)

2022年3月20日 13:41

这是我的第一篇博客

1006:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,b;
    cin>>a>>b;
    cout<<a+b;
}

1007:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,b,c;
    cin>>a>>b>>c;
    cout<<(a+b)*c;
}

1008:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,b,c;
    cin>>a>>b>>c;
    cout<<(a+b)/c; 

return 0;
}

1009:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,b;
    cin>>a>>b;
    cout<<a/b<<" "<<a%b;

return 0;
}

1010:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b;
    cin>>a>>b;
    printf("%0.9f",a/b);
}

1012:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b,c,x,d;
    cin>>x>>a>>b>>c>>d;
    printf("%0.7f",a*x*x*x+b*x*x+c*x+d);
}

1013:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b;
    cin>>a;
    b=a-32;
    b=5*b;
    b=b/9;
    printf("%0.5f",b);
}

1014:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double pi=3.14159;
    double r;
    scanf("%lf",&r);
    printf("%.4lf %.4lf %.4lf",2*r,2*pi*r,pi*r*r);
}

1015:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b;
    cin>>a>>b;
    printf("%0.2f",1/((1/a)+(1/b)));
}

1016:

#include <stdio.h>
using namespace std;
int main()

{
    printf("%d %d",sizeof(int),sizeof(short));
    return 0;
}

1017:

#include <stdio.h>
using namespace std;
int main()

{
    printf("%d %d",sizeof(float),sizeof(double));
    return 0;
}

1018:

#include <stdio.h>
using namespace std;
int main(){
    printf("%d %d",sizeof(bool),sizeof(char));
    return 0;
}

1019:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    float a;
    cin>>a;
    if(a>0)
        printf("%0.0f",floor(a));
    else
        printf("%0.0f",ceil(a));
}

1020:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    char a;
    cin>>a;
    cout<<int(a);
}

1021:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a;
    cin>>a;
    cout<<char(a);
}

1022:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a;
    cin>>a;
    cout<<int(bool(a));
}

1023:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    cout<<sizeof("Hello, World!");
}

喜欢的点赞关注哦!!!
 

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值