#include <iostream> using std::cout; using std::cin; using std::endl; using std::string; using std::getline; int main() { bool b = true; while (b) { int N; cout << "Сколько раз вам напомнить? "; cin >> N; if (N == -1) b = false; string str; cout << "Введите фразу напоминалку: "; getline(std::cin >> std::ws, str); int i = 0; while (i <= N) { i += 1; cout << "[" << i << "] " << str << endl; } } }
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