1 solutions

  • 0
    @ 2025-11-5 15:42:20

    C++ :

    #include <iostream>
    #include <cstdio>
    using namespace std;
    int main()
    {
    	int a,b,count=0;
    	cin>>a>>b;
    	for(int i=a;i<=b;i++)
    	{
    		if(i%6==0 || i%8==0)
    		{
    			count++;
    		}
    	}
    	cout<<count<<endl;
    	return 0;
    }
    
    

    Pascal :

    var a,b,i,c:longint;
    begin
      readln(a,b);
      for i:=a to b do
      if (i mod 6=0) or (i mod 8=0) then inc(c);
      write(c);
     end.
    
    • 1

    Information

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