看,错在那?这 行字我看不到 我用dos的"please input two numbers:\n";
#include <iostream>
using namespace std;
int main()
{
int a,b,num1,num2,temp;
cout << "please input two numbers:\n";
cin >> num1 >> num2;
cout << endl;
if (num1 < num2) //Exchange two numbers, so that large numbers on num1
{
temp = num1;
num1 = num2;
num2 = temp;
}
a = num1;
b = num2;
while(b!=0) //Rolling division until b is 0
{
temp = a % b;
a = b;
b = temp;
}
cout << "The gcd of number is:" << num1 * num2 / a;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a,b,num1,num2,temp;
cout << "please input two numbers:\n";
cin >> num1 >> num2;
cout << endl;
if (num1 < num2) //Exchange two numbers, so that large numbers on num1
{
temp = num1;
num1 = num2;
num2 = temp;
}
a = num1;
b = num2;
while(b!=0) //Rolling division until b is 0
{
temp = a % b;
a = b;
b = temp;
}
cout << "The gcd of number is:" << num1 * num2 / a;
return 0;
}