Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
請問C++主程式呼叫副程式的問題
May 12th 2013, 15:05

一個主程式呼叫副程式
副程式是取兩數公因式
麻煩幫我看看問題是~

 

#include <iostream>
using namespace std;

int gcd(int a, int b);

int main()
{
    int c;
    c=gcd(int a,int b);
    return 0;
}

副程式

#include <iostream>
using namespace std;
int gcd(int a, int b);

int gcd(int a, int b)
{
    if (a==0) return b;
    if (b==0) return a;
    if (a>b) return gcd(a%b, b);
    else return gcd(a, b%a);
}

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: Thatcher's Tyrants - The Tanks, The Guns, The Christmas Cards.

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜

    ksokf 發表在 痞客邦 留言(0) 人氣()