Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int h;
  7. scanf("%d",&h);
  8. int i=0;
  9. int choinka=0;
  10. int spacja=h-i;
  11.  
  12. if(h%2==0 || h%2!=0)
  13. {
  14. start:
  15. spacja=h-i;
  16. choinka=0;
  17.  
  18. if(i<h)
  19. {
  20. spacj:
  21. if(spacja<0)
  22. {
  23. goto end;
  24. }
  25. printf(" ");
  26. spacja--;
  27. goto spacj;
  28. end:
  29. gwi:
  30. if(choinka>2*i){
  31. goto end2;
  32. }
  33. printf("*");
  34. choinka++;
  35. goto gwi;
  36.  
  37. end2:
  38. printf("\n");
  39. }
  40. else if(i==h)
  41. {
  42. return 0;
  43. }
  44. zwieksz: i++;
  45. goto start;
  46. }
  47.  
  48. return 0;
  49. }
  50.  
  51.  
  52. #include <stdio.h>
  53. #include <stdlib.h>
  54.  
  55. int main()
  56. {
  57. int a=5,b=0,c;
  58. c=a;
  59. spacja:
  60. if(b>0){
  61. printf("*");
  62. }
  63.  
  64. if(b<a)
  65. {
  66. b++;
  67. if(b==c)
  68. {
  69. printf("\n");
  70. c--;
  71. b=0;
  72. if(c==0){
  73. return 0;
  74. }
  75. }
  76. goto spacja;
  77. }
  78. return 0;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement