choika 2.txt

(0 KB) Pobierz
#include <iostream>
using namespace std;
 
int main(){
    int a;
    cin>>a;
    string z="*";
    for(int i=1;i<=a;i++){
            for(int t=1; t<=a-i+1; t++) cout<<" ";
            cout<<z<<endl; 
            z+="**";     
    }
    z="*";
    for(int i=1;i<=a+1;i++){
            for(int t=1; t<=a+1-i; t++) cout<<" ";
            cout<<z<<endl; 
            z+="**";     
    }
 
}
Zgłoś jeśli naruszono regulamin