The user enters the width and height of the picture (for example, a rectangle), and the program draws it. For example :

Width = 5, height = 3.

 fffff
 fffff
 fffff

The first part of the code is ready, I don’t understand how to write.

package main import "fmt" func main() { fmt.Println("Эта программа рисует фигуру по введёным параметрам") fmt.Println() var choise uint fmt.Print("Выберете тип фигуры:") fmt.Println("1) Прямоугольник") fmt.Println("2) Ромб") fmt.Print("Фигура:") fmt.Scan(&choise) if choise == 1 { var w, h uint fmt.Print("Ведите ширину прямоугольника: ") fmt.Scan(&w) fmt.Println() fmt.Print("Введите высоту прямоугольника: ") fmt.Scan(&h) fmt.Println() } } 
  • Are you going to draw rectangles? - user192664
  • So far, yes ... Then I'm going to add a rhombus, which can be seen in the code - lifono656

1 answer 1

Colleague, you do not have enough of this (only for squares):

  func square () { for t := 0; t < 10; t++ { for i := 0 ; i < 10; i++ { fmt.Print ("@") } fmt.Println() } }