#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int a,b,c; cin>>a>>b>>c; int ans=0; for(int i = 0; i <= 10000; i++){ for(int j = 0; j <= 10000; j++){ if(a*i+b*j+c == 0) ans++; } } cout << ans << endl; return 0; }
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account