1 条题解

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

    C :

    #include<stdio.h>
    
    void main () {
    	int n;
    	scanf("%d",&n);
    	
    	if(n%30==0){
    		printf("%d",n/30);
    	}else{
    		printf("%d",n/30+1);
    	}
    }
    

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    int main(){
        int n;
        cin>>n;
    	if(n % 30 == 0){
    		cout<<n / 30;
    	}else{
    		cout<<n / 30 + 1;
    	}
    }
     
    
    

    Java :

    import java.util.Scanner;
    public class Main
    {
    	public static void main(String[] Args)
    	{
    		Scanner sc = new Scanner(System.in);
    		int a = sc.nextInt();
    		int n;
    		if(a%30 == 0)
    			n = a/30;
    		else
    			n = a/30+1;
    		System.out.println(n);
    
    	}
    }
    

    Python :

    n = int(input())
    if n % 30 == 0:
        s = n // 30
        print(s)
    else:
        s = n // 30 + 1
        print(s)
    
    
    • 1

    信息

    ID
    2540
    时间
    1000ms
    内存
    64MiB
    难度
    10
    标签
    递交数
    4
    已通过
    1
    上传者