Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
96671 秦浩然 15求两个数的最大公约数 C++ Compile Error 0 MS 0 KB 299 2024-11-09 11:42:01

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:12: error: overloaded function with no contextual type information
         min=a;
            ^
Main.cc:10:12: error: overloaded function with no contextual type information
         min=b;
            ^
Main.cc:12:15: error: cannot resolve overloaded function 'min' based on conversion to type 'int'
     for(int i=min;i>=1;i--){
               ^