Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. int ft_putchar(char c);
  2. 13 void print_first_line2(int h)
  3. 14 {
  4. 15 int i;
  5. 16
  6. 17 i = 0;
  7. 18 ft_putchar('A');
  8. 19 while (i < (h - 2))
  9. 20 {
  10. 21 ft_putchar('B');
  11. 22 i++;
  12. 23 }
  13. 24 if (h > 1)
  14. 25 ft_putchar('A');
  15. 26 ft_putchar('\n');
  16. 27 }
  17. 28
  18. 29 void print_line2(int h)
  19. 30 {
  20. 31 int i;
  21. 32
  22. 33 i = 0;
  23. 34 ft_putchar('B');
  24. 35 while (i < (h - 2))
  25. 36 {
  26. 37 ft_putchar(' ');
  27. 38 i++;
  28. 39 }
  29. 40 if (h > 1)
  30. 41 ft_putchar('B');
  31. 42 ft_putchar('\n');
  32. 43 }
  33. 44
  34. 45 void print_last_line2(int h)
  35. 46 {
  36. 47 int i;
  37. 48
  38. 49 i = 0;
  39. 50 ft_putchar('C');
  40. 51 while (i < (h - 2))
  41. 52 {
  42. 53 ft_putchar('B');
  43. 54 i++;
  44. 55 }
  45. 56 if (h > 1)
  46. 57 ft_putchar('C');
  47. 58 ft_putchar('\n');
  48. 59 }
  49. 60
  50. 61 void rush02a(int h, int v)
  51. 62 {
  52. 63 int i;
  53. 64
  54. 65 i = 0;
  55. 66 if (h < 1 || v < 1)
  56. 67 return ;
  57. 68 print_first_line2(h);
  58. 69 while (i < (v - 2))
  59. 70 {
  60. 71 print_line2(h);
  61. 72 i++;
  62. 73 }
  63. 74 if (v > 1)
  64. 75 print_last_line2(h);
  65. 76 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement