Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n;
  8. cout<<"angka : ";
  9. cin>>n;
  10. int mark = 0;
  11. int hit = 0;
  12. for(int i = 0; i<=2*n-1; i++){
  13. for(int j = 0; j<=2*n-1; j++){
  14. if(mark==0 || mark==2*n-1){
  15. cout<<"*";
  16. if(j==2*n-1){
  17. mark++;
  18. cout<<endl;
  19. }
  20. } else {
  21. if(j==0||j==mark||j==2*n-mark-1||j==2*n-1){
  22. cout<<"*";
  23. } else {
  24. cout<<" ";
  25. }
  26. if(j==2*n-1){
  27. cout<<endl;
  28. }
  29. }
  30. }
  31. if(i!=0){
  32. mark++;
  33. }
  34. }
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement