1 solutions

  • 0
    @ 2025-11-5 15:46:46

    C++ :

    //hhh
    #include <iostream>
    #include <cstdio>
    using namespace std;
    
    int main(){
        float a,p;
        cin>>a;
        if(a<=10)p=2*a;
        if(a>10)p=1.8*a;
        printf("%0.1f\n",p);
    	return 0;
    } 
    

    Pascal :

    var
    a:integer;
    s,d:real;
    begin
    read(a);
    if a<=10 then
    begin
    s:=2*a;
    write(s:0:1);
    end
    else
    begin
    d:=a*2*0.9;
    write(d:0:1);
    end; 
    end.
    
    
    • 1

    Information

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