Skip to content

Instantly share code, notes, and snippets.

@JIghtuse
Created January 28, 2016 11:38
Show Gist options
  • Save JIghtuse/2d85d39437a2764e6496 to your computer and use it in GitHub Desktop.
Save JIghtuse/2d85d39437a2764e6496 to your computer and use it in GitHub Desktop.
std::get_money
#include <iomanip>
#include <iostream>
#include <locale>
using namespace std;
int main ()
{
istream& work{cin};
cout.imbue(locale("ru_RU.utf8"));
long double amount;
while (work >> get_money(amount))
cout << "Потрачено " << showbase << put_money(amount) << endl;
}
@JIghtuse
Copy link
Author

Читает копейки, а выводит рубли 😸

$ ./money
100  
Потрачено 1.00 руб

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment