#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <unordered_map>
using namespace std;
/*解题思路:辗转相除法
输入:1 1 10
输出:10*/
int main(){
int a,b,n;
while(cin>>a>>b>>n){
int count=0;
int t;
int tmp;
if((a>n)||(b>n)){
count = 0;
}
else{
t=n/a;
for(int i=1;i<=t;i++){
tmp = a*i;
if(tmp%b==0){
count++;
}
}
}
cout<<count<<endl;
}
system("pause");
return 0;
}
招银卡中心-公倍数-c++
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。