我编的求两个数的最大公约数和程序有问题,请大家帮忙看一下.
											源码如下: 程序代码:
程序代码:
#include<iostream>
void yuns();
void yu();
int main()
{
    using namespace std;
    
    int a,b,e,f,t;
    float c,d;
    
    cout<<"请输入两个数:";
    cin>>a>>b;              
    
    if(a>=b)
            a=a,b=b;
    else
        t=a;
        a=b;
        b=t;
    e=0;    
     
     yuns();
  
     system("pause");
     return 0;
}            
                          
void yuns()
{
     int a,b,e,f,t;
    float c,d;
     f=b-e;
     c=a/f;
     d=b-f;
     yu();
}
void yu()
{
     using namespace std;
     int a,b,e,f,t;
    float c,d;
     if(c-(int)c==0)
     {
         if(d-(int)d==0)
             cout<<"\n最大公约数为:"<<f;
          else
              e++;
              yuns();
     }
     else
              e++;
              yuns();
}
结果是:
	
		
			
		
	
[ 本帖最后由 lub1990 于 2009-9-14 13:47 编辑 ]

 
											






 
	     
											

 感觉程序好乱
 感觉程序好乱										
					
	 
											

