1 条题解

  • 0
    @ 2023-6-11 12:20:41

    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

    信息

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