Advertisement
askarulytarlan

piramida c++

Oct 2nd, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cmath>
  4. #include <vector>
  5. #include <algorithm>
  6. #include <cstdio>
  7. #include <math.h>
  8.  
  9.  
  10. using namespace std;
  11.  
  12. int n;
  13.  
  14. int main(int argc, const char * argv[]) {
  15. cin>>n;
  16. int b=n-1;
  17. int c=1;
  18. for (int i=1; i<=n;i++){
  19. for(int j=1; j<=b; j++){
  20. cout<<"0";
  21. }
  22. for(int d=1; d<=c; d++){
  23. cout<<"*";
  24. }
  25. c=c+1;
  26. b=b-1;
  27. cout<<endl;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement