1 solutions

  • 0
    @ 2025-3-3 16:33:39

    C :

    #include <stdio.h>
    void main()
    {
    	int n;
    	double p;
    	scanf("%d",&n);
    	if(n>=10)
    	{
    		p=n*2;
    	}else{
    		p=n*2.2;
    	}
    	printf("%.1f",p);
    }
    

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    int main(){
       int a;
       double b;
       cin>>a;
       if(a >= 10){
       	  b = a * 2;
       }else{
       	  b = a * 2.2;
       }
       cout<<fixed<<setprecision(1)<<b<<endl;
       return 0;
    }
    
    

    Python :

    n=int(input())
    s=0
    if n>=10 and n<=100:
        s=n*2
    elif n<10 and n>0:
        s=n*2.2
    print('%.1f' %s)
    
    
    
    • 1

    Information

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