Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "ru");
- int count;
- char ch;
- int type;
- int i = 0;
- cout << "Введите количество символов: ";
- cin >> count;
- cout << "Введите символ: ";
- cin >> ch;
- do {
- cout << "Введите 1 для вывода горизонтальной линии или 2 для вывода вертикальной: ";
- cin >> type;
- } while (type != 1 && type != 2);
- if (type == 1) {
- while (i < count) {
- cout << ch;
- i++;
- }
- }
- else {
- while (i < count) {
- cout << ch << endl;
- i++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement