• 第二次实验


    #include<stdio.h>
    int main(){
    char a,b,c,d,e;
    a=getchar();
    b=getchar();
    c=getchar();
    d=getchar();
    e=getchar();
    putchar(a);
    putchar(b);
    putchar(c);
    putchar(d);
    putchar(e);
    return 0;
    }

    #include<stdio.h>
    int main(){
    printf("input the year");
    int year,d0ays;
    scanf("%d",&year);
    if(year%4==0&&year%100!=0||year%400==0){
     printf("year:");
     printf("%d",year);
     printf(",month:2");
     printf(",days:29");
    }
    else{printf("year:");
      printf("%d",year);
     printf(",month:2");
     printf(",days:28");
    }
    return 0;
    }

    #include<stdio.h>
    int main(){
    double a,b,c;
    scanf("%f%f%f",&a,&b,&c);
    if((a*a+b*b<c*c)||(b*b+c*c<a*a)||(a*a+c*c<b*b))
    {
     printf("不能构成三角形");}
    else if((a==b&&a!=c)||(a==c&&a!=b)||(b==c&&a!=b))
    {
    printf("等腰三角形");}
    else if(a==b&&b==c&&a==c)
    {
    printf("等边三角形");}
    else if((a*a+b*b==c*c)||(a*a+c*c==b*b)||(b*b+c*c==a*a))
    {
    printf("直角三角形");}
    else
    {
    printf("一般三角形");}
    return 0;
    }

    #include<stdio.h>
    int main(){
     int a;
    double rate,tax,profit;
    printf("请输入奖金数");
    scanf("%d",&a);
    switch(a/500){
    case 0:rate=0.00;break;
    case 1:rate=0.05;break;
    case 2:rate=0.08;break;
    case 3:rate=0.08;break;
    case 4:rate=0.10;break;
    case 5:rate=0.10;break;
    case 6:rate=0.10;break;
    case 7:rate=0.10;break;
    case 8:rate=0.10;break;
    case 9:rate=0.10;break;
    default:rate=0.15;
    }
    tax=a*rate;
    profit=a-tax;
    printf("税率");
    printf("%lf ",rate);
    printf("应缴税款");
    printf("%lf ",tax);
    printf("实得奖金数");
    printf("%lf",profit);
    return 0;
    }

    #include<stdio.h>
    int main(){
     int a;
    double rate,tax,profit;
    printf("请输入奖金数");
    scanf("%d",&a);
    if(a<500){
    rate=0;}
    else if(a<1000){
    rate=0.05;}
    else if(a<2000){
    rate=0.08;}
    else if(a<5000){
    rate=0.10;}
    else{
    rate=0.15;}
    tax=a*rate;
    profit=a-tax;
    printf("税率");
    printf("%lf ",rate);
    printf("应缴税款");
    printf("%lf ",tax);
    printf("实得奖金数");
    printf("%lf",profit);
    return 0;
    }

  • 相关阅读:
    解决centos7的root账户下无法通过code命令启动vscode
    centos7安装epel
    centos7用过yum安装vscode
    yum install gcc报错Error: Package: glibc-2.17-260.el7_6.6.i686 (updates) Requires: glibc-common = 2.17
    centos7通过yum从vim7升级到vim8
    解决VM虚拟机安装centos7无法联网
    centos7设置开机默认使用root账户登陆
    centos7使用sudo命令提示sudo command not found
    不同编译器下C++基本数据类型的字节长度
    C++函数模板
  • 原文地址:https://www.cnblogs.com/p201821440040/p/10750537.html
Copyright © 2020-2023  润新知