Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
31585 | 惠子铭 | 不定方程求解 | C++ | Accepted | 0 MS | 244 KB | 324 | 2023-11-19 18:34:40 |
#include<iostream> using namespace std; int main(){ int a,b,c,x,y,s=0;//设一个a,b,c,x,y,和一个最开始为0的s。 cin>>a>>b>>c; for(x=0;x<=c/a;x++){//喧哗x=0,x小于等于c÷a,x不停的加。 y=(c-a*x)/b; if(a*x+b*y==c)s++;//如果若a×x+b×y=C,S不停的加。 } cout<<s; return 0; }