In C++, When I calculate 2/3, it will output decimal values, how can I just get the original format (i.e.g 2/3) instead of 0.66666667
Thanks
You can store all your fraction's numerators and denominators as intergers. Integers have exact representations in binary.