zoukankan      html  css  js  c++  java
  • 第二次实验

    #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;
    }

  • 相关阅读:
    CF1080D Olya and magical square
    CF1062D Fun with Integers
    leetcode378 Kth Smallest Element in a Sorted Matrix
    hdoj薛猫猫杯程序设计网络赛1003 球球大作战
    hihocoder1068 RMQ-ST算法
    hihocoder1032 最长回文子串
    hihocoder1394 网络流四·最小路径覆盖
    hihocoder1398 网络流五·最大权闭合子图
    【bzoj4562】HAOI2016食物链
    【bzoj1026】windy数
  • 原文地址:https://www.cnblogs.com/p201821440040/p/10750537.html
Copyright © 2011-2022 走看看