stdio支持

This commit is contained in:
ArchZer0
2026-08-16 16:28:12 +08:00
parent 1f8fa26d73
commit ceb7c3fa44
11 changed files with 249 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
#include <bstl/big_integer.hpp>
#include <bstl/big_decimal.hpp>
#include <bstl/string.hpp>
#include <iostream>
int main() {
using bstl::BigInteger;
using bstl::BigDecimal;
using bstl::String;
std::cout << "=== BetterSTL cin/cout Demo ===\n\n";
// BigInteger 示例
std::cout << "BigInteger Example:\n";
std::cout << "Enter a large integer: ";
BigInteger bi;
std::cin >> bi;
std::cout << "You entered: " << bi << "\n";
std::cout << "Doubled: " << (bi * BigInteger(2)) << "\n\n";
// BigDecimal 示例
std::cout << "BigDecimal Example:\n";
std::cout << "Enter a decimal number: ";
BigDecimal bd;
std::cin >> bd;
std::cout << "You entered: " << bd << "\n";
std::cout << "Doubled: " << (bd * BigDecimal(2)) << "\n\n";
// String 示例
std::cout << "String Example:\n";
std::cout << "Enter a word: ";
String str;
std::cin >> str;
std::cout << "You entered: " << str << "\n";
std::cout << "Uppercase: " << str.upper() << "\n";
std::cout << "Lowercase: " << str.lower() << "\n\n";
std::cout << "Demo completed!\n";
return 0;
}