提交时间:2024-01-25 14:50:11
运行 ID: 38152
#include <iostream> using namespace std; int maths(int a, int b, int c){ int count=0; for (int x=0;x<=c/a;x++){ int y=(c-a*x)/b; if((c-a*x)%b==0&&y>=0){ count++; } } return count; } int main() { int a, b, c; cin>>a>>b>>c; int sum=maths(a, b, c); cout<<sum<<endl; return 0; }