- Leave-绿光
- 2009-06-11 16:40:47 @
#include
#include
long long getfactor(long long m,long long n)
{
long temp;
if(m>n)
{
temp=m;
m=n;
n=temp;
}
while (m!=0)
{
temp=n%m;
n=m;
m=temp;
}
return n;
}
int main()
{
long long a[10],b[10],c[10],g[10];
int i;
for(i=0;i
4 条评论
-
PeterWang LV 8 @ 2017-02-05 17:27:32
#include <iostream>
#include <cstdlib>
using namespace std;long long gcd (long long a,long long b)
{
if (b!=0) return (gcd(b,a%b));
else return a;
}int main ()
{
long long a[11],b[11],c[11],g[11];
for (int i=1;i<=10;i++)
{
cin>>a[i]>>b[i];
}
for (int i=1;i<=10;i++)
{
c[i]=a[i]+b[i];
g[i]=gcd(a[i],b[i]);
cout<<c[i]-g[i]<<endl;
}
//while (1);
return 0;
} -
2017-02-05 17:27:24@
笨蛋,我AC了。
-
2016-02-17 17:09:13@
我也是
-
2016-02-16 14:56:19@
我也是
- 1