1 solutions

  • 0
    @ 2025-11-5 18:52:40

    C :

    #include <stdio.h>
    int main(){
        long long n, b, cnt;
        while(scanf("%lld %lld", &n, &b) != EOF){
            int i;
            cnt = 0;
            for(i = b; i <= n; i += b) cnt++;
            printf("%lld\n", cnt);
        }
        return 0;
    }
    

    C++ :

    #include "cstdio"
    int main()
    {
    	int a,b;
    	while(scanf("%d%d",&a,&b)!=EOF)
    		printf("%d\n",a/b);
    	return 0;
    }
    

    Java :

    import java.util.Scanner;
    public class Main
    {
    	public static void main(String[] args)
    	{
    		Scanner sc=new Scanner(System.in);
    		while(sc.hasNext())
    		{
    			int n=sc.nextInt();
    			int b=sc.nextInt();
    			System.out.println(n/b);
    		}
    	}
    }
    
    • 1

    Information

    ID
    19076
    Time
    3000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By