Advertisement
RieqyNS13

Triangle-Loop-Generator

Jul 2nd, 2012
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.61 KB | None | 0 0
  1. //----------------------------------------//
  2. //Coded by:RieqyNS13                  //
  3. //Name:Triangle-Loop-Generator //
  4. //Compiler:DevC++(General)     //
  5. //Level=Beginners ^_^             //
  6. //Note:This script is Not Hack,_//
  7. //_but just a logical statement//
  8. //---------------------------------//
  9. #include <iostream>
  10. #include <string>
  11. #include <iomanip>
  12. #include <windows.h>
  13. using namespace std;
  14. int main()
  15. {  
  16. system("color 0A");  
  17. system("TITLE looping Mas bro");  
  18. unsigned long int loop, time, a=0, x;  
  19. char set = ' ';  
  20. cout<<"Input Looping = ";  
  21. cin>>loop;  
  22. cout<<"Input Interval = ";  
  23. cin>>time;  
  24. cout<<"Input Setfill Variabel = ";  
  25. cin>>set;    //Kalkulasi'_'//  
  26. while(loop=loop-1)  
  27. {
  28.                       int t=loop+1;
  29.                       for(int a=1; a<=loop; a=a+1)                    
  30. {
  31.                               int c=a;
  32.                               c=c*2;
  33.                               t=t-1;                            
  34. cout<<setfill(' ')<<setw(t)<<" "<<setfill(set)<<setw(c)<<" "<<endl;                                           Sleep(time);                
  35.                           }                    
  36. x=loop;                    
  37. for(int b=1; b<=loop; b=b+1)
  38.                 {                            
  39. x=x-1;                            
  40. int z=b, v=x;                            
  41. v=v*2;                            
  42. z=z+1;                            
  43. cout<<setfill(' ')<<setw(z)<<" "<<setfill(set)<<setw(v)<<" "<<endl;                                         Sleep(time);
  44.                     }  
  45. }  
  46. ////maho//////  
  47. system ("pause>nul");  
  48. return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement