Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
91017 梁敖铭 最大公约数(函数) C++ Compile Error 0 MS 0 KB 350 2024-09-20 22:04:38

Tests(0/0):


Code:

#include<iostream> using namespace std; int f(int m, int n){ int min = (m <= n)?m:n; for(int i = min; i >= 1; i--){ if(m % i == 0 && n % i ==0) return i; } } int fu(int m, int n){ int max = (m >= n)?m:n; int i = max; while (i % m != 0 || i % n != 0) { i++; } return i; }


Run Info:

Main.cc: In function 'int f(int, int)':
Main.cc:9:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status