Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
1249 李羽 15求两个数的最大公约数 C++ Compile Error 0 MS 0 KB 224 2023-08-23 10:52:59

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int a,b,y,temp; cin>>a>>b; if(a<b){ temp=a; a=b; b=temp; } while(1){ y=a%b; if(y==0) cout<<b;break; else a=b;b=y; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:15:3: error: 'else' without a previous 'if'
   else
   ^