diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-07-26 02:13:23 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-07-26 02:54:02 +0100 |
commit | 5cbdf7a045c18877b8ae83a7f105e1cf32866a79 (patch) | |
tree | 74a8abb80f82893c105fcbb7a03d640411946ab0 | |
parent | aad22a1b203c2e8dcdc564da9e94f7b7796d0221 (diff) | |
download | cw_tree-5cbdf7a045c18877b8ae83a7f105e1cf32866a79.tar.gz cw_tree-5cbdf7a045c18877b8ae83a7f105e1cf32866a79.tar.bz2 cw_tree-5cbdf7a045c18877b8ae83a7f105e1cf32866a79.zip |
Added to_string for fractions
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index d355694..91accad 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -75,6 +75,13 @@ struct Fraction } }; +std::string to_string(const Fraction &f) +{ + std::stringstream ss; + ss << f.numerator << "/" << f.denominator; + return ss.str(); +} + struct Node { Fraction value; |