由买买提看人间百态

topics

全部话题 - 话题: inumerator
(共0页)
a****m
发帖数: 693
1
#include
using namespace std;
class CFraction
{
public: //public method to get GCD
int iNumerator;
int iDenominator;
double dValue;
//constructor...
CFraction( int iNumeratorParam, int iDenominatorParam )
{
iNumerator = iNumeratorParam;
iDenominator = iDenominatorParam;
dValue = iNumerator/ iDenominator;
}
//getGCD
int getGCD( int iNumerator, int iDenominator )
{
int remainder = iDenominator % iNumerator;
if ( remainder != 0 )
return getGCD( remainder,iNumerator );
}
//Reduce (wha... 阅读全帖
a****m
发帖数: 693
2
#include
#include "GCD.hpp"
using namespace std;
class CFraction
{
public: //private method to get GCD
int iNumerator;
int iDenominator;
//constructor...
CFraction( int iNumeratorParam, int iDenominatorParam )
{
iNumerator = iNumeratorParam;
iDenominator = iDenominatorParam;
}
//getGCD
int getGCD( int iNumerator, int iDenominator )
{
int remainder = iDenominator % iNumerator;
if ( remainder != 0 )
return getGCD( remainder,iNumerator );
else return 0;
}
CFraction reduce()
{
int iGC... 阅读全帖
s***a
发帖数: 299
3
//getGCD
int getGCD( int iNumerator, int iDenominator )
{
int remainder = iDenominator % iNumerator;
if ( remainder != 0 )
return getGCD( remainder,iNumerator );
// I think you must add else here since you must return an int here
}
a****m
发帖数: 693
4
CFraction reduce()
{
int iGCD = getGCD(int iNumerator, int iDenominator);
// 总是在这一行出问题: expected primary-expression before "int"
//It seems that it does not need redefine the type, getGCD(inum, idenom)
iNumerator=iNumerator/iGCD;
iDenominator=iDenominator/iGCD;
}
thanks all you guys!
S**********s
发帖数: 4534
5
来自主题: GunsAndGears版 - Valuable WWII Gun at Police Buy-Back [zz]
There are still plenty of full auto stg44s around in small third world
countries, though most likely yugoslavia copies, just not that many in the u
.s. in fact George Lucas' star war movies used a bunch of stg44s as prop,
they were owned by the British.
Because there had been half a million stg44s and inumerable yugo copies, the
gun is only valuable due to it is a machine gun (I hope it's registered)
a real valuable piece would have been an FG42.
A**d
发帖数: 13310
6
TheDutch had a plan. Kick, kick, give the ball to Robben and pray, karate
kick and then kick again(not the ball, but the Spaniards). It threw Spain
off for the most part but they kept enough composure to win it in the end.
It is a disgrace tha De Jong&Van Bommel wernt sent off in almost 120 minutes
of UFC football! Great saves by both Goalkeepers.
Thx to the inept ref who didn抰 have the guts to show 2nd yellow for the
inumerable fouls & Dutch tactics now Spain proved they can overcome scumbag
ta
t****t
发帖数: 6806
7
int iGCD = getGCD(int iNumerator, int iDenominator);
哦, 这一行啊, 你看你写的是什么呀? copy/paste也不能这样啊.
c**b
发帖数: 2999
8
1.這個函数有返回值吗? 没看见里面有return;
2.int iGCD = getGCD(iNumerator,iDenominator);
(共0页)