avatar
vẽ đối xứng qua * với string cho trước

nk3aqtb 1.8K 23rd Jun, 2021

#include <bits/stdc++.h>
using namespace std;
int main()
{
    char s;
    cin >> s;
    int a;
    cin >> a;
    if((a - 1) % 2 != 0)
    {
        cout << "CAN'T";
        goto ee;
    }
    for(int i = 0; i < (a - 1) / 2; i++)
    {
        cout << "*";
    }
    cout << s;
    for(int i = 0; i < (a - 1) / 2; i++)
    {
        cout << "*";
    }
    ee: return 0;
}
C++
Description

No description

To share this paste please copy this url and send to your friends
RAW Paste Data