3 条题解

  • 1
    @ 2023-09-24 17:42:14

    数据甚至不超过20
    直接暴力打表

    l=[2.5,1.5,0.5,-0.5,-1.5,-4,-11.5,-22,-35.5,-52,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8]
    print("%.3f"%l[int(input())])
    
  • 1
    @ 2018-11-07 13:39:43
    #include <stdio.h>
    #include <iostream>
    using namespace std;
    double x;
    int main()
    {
        cin>>x;
        if(x<5) printf("%.3f",-x+2.5);
        else if(x<10) printf("%.3f",2-1.5*(x-3)*(x-3));
        else printf("%.3f",x/2-1.5);
        return 0;
    }
    
  • 0
    @ 2018-12-28 17:13:54
    x=float(input())
    if      0<=x<5:    print('%.3f'%(-x+2.5))
    elif    5<=x<10:   print('%.3f'%(2-1.5*(x-3)*(x-3)))
    elif    10<=x<20:  print('%.3f'%(x/2-1.5))
    

    代码必须要整齐

  • 1

信息

难度
4
分类
(无)
标签
(无)
递交数
909
已通过
157
通过率
17%
上传者