Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
57253 zhangweiran 求两个数的公约数 C++ Accepted 0 MS 244 KB 214 2024-11-22 14:22:44

Tests(1/1):


#include<iostream> using namespace std; int main() { int a,b; cin>>a>>b; int S=0; for(int i=1;i<=min(a,b);i++){ if(a%i==0&&b%i==0){ S+=1; cout<<i<<" "; } } cout<<endl<<S; return 0; }


Judgement Protocol: