Programming Basics C++
Някои може ли да ми даде еквивалента на представяне на :
Console.WriteLine("*{0}*",new string(' ',n-2)); на C#
в C++ ?
Някои може ли да ми даде еквивалента на представяне на :
Console.WriteLine("*{0}*",new string(' ',n-2)); на C#
в C++ ?
#include <iostream>
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
    int *a, counter;
    scanf("%i", &counter);
    a = new int[counter];
    std::cout << std::string(counter, '*');
    cout << endl;
    for (int i = 0; i < counter - 2; i++)
    {
        cout << "*";
        cout << std::string(counter - 2, ' ');
        cout << "*" << endl;
    }
    std::cout << std::string(counter, '*') << endl;
}
Благодаря ти.