#include <iostream> using std::cout; using std::cin; int main() { int Ruble = 0; cout << "Введите количество денег: "; cin >> Ruble; if (Ruble % 10 == 0 || Ruble % 10 >= 5 || (Ruble / 10) % 10 == 1){ cout << Ruble << " рублей"; }else if (Ruble % 10 == 1){ cout << Ruble << " рубль"; }else { cout << Ruble << " рубля"; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter