Answer the question
In order to leave comments, you need to log in
How to pad the end of each line with '*' character?
As a result of the task, if N, for example, enter 6, then it should come out:
A*****
AB****
ABC***
ABCD**
ABCDE*
ABCDEF
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
setlocale(LC_ALL , "Russian");
int N;
cout << "Введите N";
cin >> N;
ofstream file("proga.txt");
for (int i = 0; i < N; i++)
{
for (char j = 'A'; j <= 'A' + i; j++)
file << j;
file << '\n';
}
file.close();
return 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question