1 solutions

  • 0
    @ 2025-11-5 15:56:48

    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

    Information

    ID
    17360
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By