2 solutions

  • 1
    @ 2025-1-12 15:06:58
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int m,n;
    	cin>>m>>n;
    	int t=m;
    	int s=0;
    	while(t<=n) //枚举m到n之间的所有数 
    	{
    		if(t%17==0) //判断17的倍数 
    		{
    			s+=t;
    		}
    		t++;
    	}
    	cout<<s;
    	return 0;
    }
    
    • 1
      @ 2024-12-15 16:30:29
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int m,n;
      	cin>>m>>n;
      	int s=0;
      	for(int i=m;i<=n;i++)
      	{
      		if(i%17==0)
      		s+=i;
      	}
      	cout<<s;
      	return 0;
      }
      
      • 1

      Information

      ID
      47
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      1
      Tags
      (None)
      # Submissions
      205
      Accepted
      75
      Uploaded By