1 solutions

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

    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

    Information

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