Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
41568 lihaocheng 求两个数的最大公约数 C++ Wrong Answer 1 MS 240 KB 245 2024-02-21 19:26:55

Tests(0/1):


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


Judgement Protocol: