#include
using namespace std;
Int gongyue (int n, int m);
Int gongbei (int a, int b);
Int main ()
{
Int nn, mm, make, bei, n, m;
Cout & lt; <"Please input the first number:";
Cin & gt;> Nn;
Cout & lt; <"Please input the second number:";
Cin & gt;> Mm;
Make=gongyue (n, m);
Cout & lt; <"Minimum common divisor is:" & lt;
Cout & lt; <"LCD is:" & lt;
Int gongyue (int n, int m)
{
Int r=1;
While (r!=0)
{
R=n % m;
N=m;
M=r;
}
Return n.
}
Int gongbei (int a, int b)
{
Int y=gongyue (n, m);//undefined identifiers "n", "m" is an undefined identifier
Int bei=a * b/y;
Return bei.
}
CodePudding user response:
No problem, where you define the inside function n, m, and no global variables called n, mCodePudding user response:
According to the compiler to adjust error continue to debug, finally saw a questions on some posts.CodePudding user response:
#include
using namespace std;
Int gongyue (int n, int m);
Int gongbei (int a, int b);
Int main ()
{
//int nn, mm, make, bei, n, m;
Int nn, mm, make, bei;
Cout & lt; <"Please input the first number:";
Cin & gt;> Nn;
Cout & lt; <"Please input the second number:";
Cin & gt;> Mm;
//make=gongyue (n, m);
Make=gongyue (nn, mm);
Cout & lt; <"Minimum common divisor is:" & lt;Bei=gongbei (nn, mm);
//cout & lt; <"LCD is:" & lt;Cout & lt; <"LCD is:" & lt; }
Int gongyue (int n, int m)
{
Int r=1;
While (r!=0) {
R=n % m;
N=m;
M=r;
}
Return n.
}
Int gongbei (int a, int b)
{
//int y=gongyue (n, m);//undefined identifiers "n", "m" is an undefined identifier
Int y=gongyue (a, b);
Int bei=a * b/y;
Return bei.
}
CodePudding user response:
Thank you very much. 'omega `?) ! From the small white admire eyes!CodePudding user response:
I also met the same problem, apparently seems incredible, but I finally check out was a function definition "(" bracket into the Chinese symbols, hope to see as much as I do wrong people