Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
94789 杜洛雨泽 最大公约数 C++ Compile Error 0 MS 0 KB 363 2024-10-26 13:33:04

Tests(0/0):


Code:

#include <bits/stdc++.h> using namespace std; int main (){ int num1,num2,gcd; cout<<"请输入第一个正整数:"; cin>>num1; cout<<"请输入第二个正整数:"; cin>>num2; gcd=(num1<num2)?num1:num2; if(num1%gcd==0&&num2%gcd==0){ break; } gcd--; } cout<<"最大公约数为:"<<f<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:5: error: break statement not within loop or switch
     break; 
     ^
Main.cc: At global scope:
Main.cc:18:2: error: 'cout' does not name a type
  cout<<"最大公约数为:"<