Advertisement
Guest User

Untitled

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