Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- char input[100];
- int baris, kolom;
- cout<<"Masukan Kalimat = ";
- cin.getline(input, 100);
- int x=0;
- for(baris=0; baris<strlen(input)*2-1; baris++){
- for(kolom=0; kolom<strlen(input)*3; kolom++){
- if(kolom==strlen(input)-x || kolom==strlen(input)+x){
- if(baris<strlen(input)){
- cout<<input[baris]<<" ";
- }
- else{
- cout<<input[strlen(input)-(baris-strlen(input)+2)]<<" ";
- }
- }
- else{
- cout<<" ";
- }
- }
- cout<<endl;
- ((baris<strlen(input)-1) ? x++ : x-- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement