返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int N,K,x;   
  7.     cin>>N;   
  8.     cin>>K;                           
  9.    for(int i=1;i<=N;i++)
  10.    {
  11.    while(i>K)
  12.     {
  13.         if(i%K==0)
  14.         {
  15.            x++;      
  16.         }     
  17.     }   
  18.    }
  19.    cout<<x;
  20. system("pause");
  21. return 0;   
  22. }
複製代碼

TOP

返回列表