1 条题解

  • 0
    @ 2025-4-7 21:41:51

    C++ :

    #include<iostream>
    #include<stdio.h>
    using namespace std;
    int main()
    {
    	int a,b,c,d,e,f,g,h,i;
    	scanf("%d",&a);
    	while(a>=10000)
    	{
    		cout<<a/95*2<<".00"<<endl;
    		return 0;
    	}
    	while(a>=5000)
    	{
    		cout<<a/97*2<<".00"<<endl;
    		return 0;
    	}
    	while(a>=1000)
    	{
    		cout<<a/98*2<<".00"<<endl;
    		return 0;
    	}
    	
    }
    

    Pascal :

    var
    a,b:real;
    begin
    readln(a);
    if a>=10000 then b:=a*0.05
    else if a>=5000 then b:=a*0.03
    else if a>=1000 then b:=a*0.02
    else b:=0;
    writeln(b:0:2);
    end.
    
    • 1

    信息

    ID
    2047
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者