1 solutions

  • 0
    @ 2025-3-3 16:28:35

    C :

    #include<stdio.h>
    int main()
    {
        int x;
        scanf("%d",&x);
        if(x<=100)
            printf("%d",2*x);
        if(x>100)
            printf("%d",100+x);
            return 0;
    }
    
    

    Java :

    import java.util.Scanner;
    
    public class Main {
    
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		Scanner sc = new Scanner(System.in);
    		int n = sc.nextInt();
    		int s;
    		if(n <= 100){
    			s = 2 * n;
    			System.out.println(s);
    		}else if(n > 100){
    			s = 2 * 100 + (n - 100) * 1;
    			System.out.println(s);
    		}
    	}
    
    }
    

    Python :

    n = int(input())
    if n <= 100:
        m = n * 2
    else:
        m = (n - 100) * 1 + 2 * 100
    print(m)
    
    • 1

    Information

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