Guest User

Cetrefil

a guest
Nov 7th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1. #include <iostream>
  2. #include <locale.h>
  3. #include <stdlib.h>
  4. #include <conio.h>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     setlocale(LC_ALL, "Turkish");
  11.     int StunAdet;
  12.     char Karakter;
  13.     int Ara=0;
  14.     cout << "Hangi Karakter Yazılsın : ";
  15.     cin >> Karakter;
  16.     cout << "Kac Satırlık Çizilsin : ";
  17.     cin >> StunAdet;
  18.  
  19.     for (int k = StunAdet; k > 0; k--) // Üst
  20.     {
  21.        
  22.         for(int j = k; j > 0; j--)//KarakterSol
  23.         {
  24.             cout << Karakter;
  25.         }
  26.        
  27.         for(int m = 0; m < Ara ; m++)//Boşluk
  28.         {
  29.             cout << " ";
  30.         }
  31.  
  32.         Ara+=2;    
  33.         for(int n = k; n > 0; n--)//KarakterSağ
  34.         {
  35.             cout << Karakter;
  36.         }
  37.         cout << endl;
  38.     }
  39.  
  40.     for(int i = 1; i <= StunAdet ; i++) // Alt
  41.     {
  42.         for(int j = 0; j<i ; j++) // KarakterSol
  43.         {
  44.             cout << Karakter;
  45.         }
  46.  
  47.         Ara-=2;
  48.         for(int m = 0; m < Ara ; m++) //Boşluk
  49.         {
  50.             cout << " ";
  51.         }
  52.  
  53.         for(int n = 0; n < i; n++)//KarakterSağ
  54.         {
  55.             cout << Karakter;
  56.         }
  57.         cout << endl;
  58.     }
  59.  
  60.     system("PAUSE");
  61.     return 0;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment