,答案如下:
1 2007
2 2006
4 2004
8 2000
251 1757
502 1506
1004 1004
解题源代码:#include <stdio.h>
#include <conio.h>
unsigned long int MaxDec
(unsigned long int a,unsigned long int b)
{
unsigned long int c=1;
while(c!=0)
{
c=a%b;a=b;b=c;
}
return a;
}
unsigned long int MinDec
(unsigned long int a,unsigned long int b)
{
unsigned long int c=MaxDec(a,b);
return c*(a/c)*(b/c);
}
void main(void)
{
unsigned long int y=0;
for(unsigned long int x=1;x<2008;x++)
{
y=2008-x;
if(MinDec(x,y)+MaxDec(x,y)==2008)
{
printf("%ld\t%ld\r\n",x,y);
}
}
printf("Over\r\n");
getch();
}