#19171: 哪裡錯LER


willychen0518@gmail.com (陳冠瑋)

School : Not Student
ID : 101169
IP address : [61.228.230.154]
Last Login :
2019-09-10 23:19:46
a024. 最大公因數(GCD) | From: [61.228.230.154] | Post Date : 2019-09-10 23:14

#include <iostream>
using namespace std;
int main()
{
int a,b,t;
for(cin>>a>>b;b!=0;a=t)
{
t=b;
b=a%b;

}
cout<<a<<endl;

return 0;
}

 

測試AC   解題WA(line:2)

感謝大大幫忙!!!!

 
ZeroJudge Forum