Ответы: задачи для всех рк
Описание
Характеристики ответов (шпаргалок)
Список файлов
- 3 hr
- 3 rk Pigs grib sveti.txt 2,34 Kb
- 3 rk tsvety_krug_matr.txt 3,48 Kb
- 3 rkFlowers (1).txt 2,79 Kb
- 3 rktsvety_po_krugu_i_treugolnikom_1.txt 2,2 Kb
- Flowers (2).txt 2,79 Kb
- Flowers.txt 2,79 Kb
- Novy_textovy_dokument (1).txt 810 b
- Novy_textovy_dokument (2).txt 810 b
- Novy_textovy_dokument (3).txt 810 b
- Novy_textovy_dokument.txt 810 b
- grafika (1).txt 4,68 Kb
- grafika.txt 4,68 Kb
- griby_v_shakhmat.txt 802 b
- nizhny_treugolnik.txt 539 b
- shakhmat.txt 586 b
- гляньте =).docx 387,2 Kb
Imports System.Draqwing
Public Class Form1
Dim g As Graphics
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i, i2, n, m, k, j, x, y, x1, y1, x2, y2 As Integer
g = Me.CreateGraphics
Dim kist1 As New SolidBrush(Color.LightBlue)
g.FillRectangle(kist1, 0, 0, Me.Width, Me.Height)
n = (Me.Height - 60) \ 60
m = (Me.Height - 60) \ 120
k = (Me.Width - 220) \ 100
j = (Me.Height - 60) \ 150
x = 60
y = 60
For i = 1 To n
Flower(x, y)
y = y + 60
Next
x1 = 150
y1 = 60
For i = 1 To m
Grib(x1, y1)
y1 = y1 + 100
Next
x2 = 220
y2 = 60
For i = 1 To k
For i2 = 1 To j
Pig(x2, y2)
x2 = x2 + 100
y2 = y2 + 130
Next
Next
End Sub
Private Sub Flower(ByVal x As Integer, ByVal y As Integer)
Dim kist1 As New SolidBrush(Color.Yellow)
g.FillEllipse(kist1, x, y - 10, 20, 20)
g.FillEllipse(kist1, x - 10, y, 20, 20)
g.FillEllipse(kist1, x, y + 10, 20, 20)
g.FillEllipse(kist1, x + 10, y, 20, 20)
kist1.Color = Color.Red
g.FillEllipse(kist1, x, y, 20, 20)
End Sub
Private Sub Grib(ByVal x1 As Integer, ByVal y1 As Integer)
Dim kist1 As New SolidBrush(Color.Brown)
g.FillEllipse(kist1, x1, y1, 40, 60)
kist1.Color = Color.Gray
g.FillPie(kist1, x1 - 30, y1 - 10, 100, 50, 180, 180)
End Sub
Private Sub Pig(ByVal x2 As Integer, ByVal y2 As Integer)
Dim kist1 As New SolidBrush(Color.Red)
Dim Uho1() As Point = {New Point(x2, y2 - 20), New Point(x2 + 30, y2 + 5), New Point(x2, y2 + 30)}
g.FillPolygon(kist1, Uho1)
Dim uho2() As Point = {New Point(x2 + 80, y2 + 30), New Point(x2 + 80, y2 - 20), New Point(x2 + 50, y2 + 5)}
g.FillPolygon(kist1, uho2)
kist1.Color = Color.Pink
g.FillEllipse(kist1, x2, y2, 80, 80)
kist1.Color = Color.DeepPink
g.FillEllipse(kist1, x2 + 30, y2 + 30, 20, 20)
kist1.Color = Color.Black
g.FillEllipse(kist1, x2 + 20, y2 + 20, 10, 10)
g.FillEllipse(kist1, x2 + 50, y2 + 20, 10, 10)
End Sub
End Class
По окружности
Imports System.Drawing
Public Class Form1
Dim g As Graphics
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i As Integer, x, y, f, r As Single
r = 170 : f = 0
g = Me.CreateGraphics
For i = 1 To 12
x = (Me.Width \ 2) + r * Math.Cos(f) - 40
y = (Me.Height \ 2) + r * Math.Sin(f) - 60
цветок(x, y)
f = f + Math.PI / 6
Next
End Sub
Private Sub цветок(ByVal x As Integer, ByVal y As Integer)
Dim k As New SolidBrush(Color.Green)
Dim p As New Pen(Color.Green, 4)
g.DrawLine(p, x + 20, y + 20, x + 20, y + 100)
Dim t() As Point = {New Point(x + 20, y + 100), New Point(x + 20, y + 60), New Point(x + 40, y + 50)}
g.FillPolygon(k, t)
k.Color = Color.Red
g.FillEllipse(k, x, y, 20, 20)
g.FillEllipse(k, x, y + 20, 20, 20)
g.FillEllipse(k, x + 20, y, 20, 20)
g.FillEllipse(k, x + 20, y + 20, 20, 20)
k.Color = Color.LightPink
g.FillEllipse(k, x + 10, y + 10, 20, 20)
End Sub
---------------------------------------- --------------------------------------
Квадратная матрица треугольник
Imports System.Drawing
Public Class Form1
Dim g As Graphics
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i, j, n, h, x, y As Integer
g = Me.CreateGraphics
Dim k As New SolidBrush(Me.BackColor)
g.FillRectangle(k, 0, 0, Me.ClientSize.Width, Me.ClientSize.Height)
n = Val(InputBox("Введите количество рядов"))
h = Me.Height / n
y = 0
For i = 1 To n
x = 0
For j = 1 To n
If i >= j Then цветок(x, y, h)
x = x + h
Next
y = y + h
Next
End Sub
Private Sub цветок(ByVal x As Integer, ByVal y As Integer, ByVal h As Integer)
Dim k As New SolidBrush(Color.Green)
Dim p As New Pen(Color.Green, 4)
g.DrawLine(p, x + h \ 6, y + h \ 6, x + h \ 6, y + (h \ 6) * 5)
Dim t() As Point = {New Point(x + h \ 6, y + (h * 5 \ 6)), New Point(x + h \ 6, y + (h * 3 \ 6)), New Point(x + (h * 2 \ 6), y + (h * 2 \ 6))}
g.FillPolygon(k, t)
k.Color = Color.Red
g.FillEllipse(k, x, y, h \ 6, h \ 6)
g.FillEllipse(k, x + h \ 6, y + h \ 6, h \ 6, h \ 6)
g.FillEllipse(k, x + h \ 6, y, h \ 6, h \ 6)
g.FillEllipse(k, x, y + h \ 6, h \ 6, h \ 6)
k.Color = Color.LightPink
g.FillEllipse(k, x + h \ 12, y + h \ 12, h \ 6, h \ 6)
End Sub
---------------------------------------- ---------------------------------------- ---
Квадратная матрица шахматный порядок
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i, j, n, h, x, y As Integer
g = Me.CreateGraphics
Dim k As New SolidBrush(Me.BackColor)
g.FillRectangle(k, 0, 0, Me.ClientSize.Width, Me.ClientSize.Height)
n = Val(InputBox("Введите количество рядов"))
h = Me.Height / n
For i = 1 To n
If i Mod 2 <> 0 Then
x = 0
Else : x = h \ 2
End If
For j = 1 To n
цветок(x, y, h)
x = x + h
Next
y = y + h
Next
End Sub
---------------------------------------- ---------------------------------------- -
Public Class Form1
Dim g As Graphics
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i, n, x, y As Integer
Dim kist1 As New SolidBrush(Color.LightGreen)
g = Me.CreateGraphics
g.FillRectangle(kist1, 0, 0, Me.Width, Me.Height)
x = 60
y = 60
n = (Me.Height - 60) \ 100
For i = 1 To n
Flower(x, y)
y = y + 100
Next
End Sub
Private Sub Flower(ByVal x As Integer, ByVal y As Integer)
Dim kist1 As New SolidBrush(Color.Yellow)
g.FillEllipse(kist1, x, y - 10, 20, 20)
g.FillEllipse(kist1, x - 10, y, 20, 20)
g.FillEllipse(kist1, x, y + 10, 20, 20)
g.FillEllipse(kist1, x + 10, y, 20, 20)
kist1.Color = Color.Red
g.FillEllipse(kist1, x, y, 20, 20)
Dim pero1 As New Pen(Color.Green, 4)
g.DrawLine(pero1, x + 10, y + 30, x + 10, y + 70)
Dim List() As Point = {New Point(x + 10, y + 40), New Point(x + 10, y + 60), New Point(x + 20, y + 35)}
kist1.Color = Color.Green
g.FillPolygon(kist1, List)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim x, y, fi, r As Single, i, n As Integer
g = Me.CreateGraphics()
r = 100
n = Val(InputBox("Введите количество цветочков"))
fi = 0
For i = 1 To n
x = Me.Width \ 2 + r * Math.Cos(fi)
y = Me.Height \ 2 + r * Math.Sin(fi)
Flower(x, y)
fi = fi + (Math.PI * 2) / n
Next
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim x, y, i, n As Integer
g = Me.CreateGraphics
x = 60
y = 60
n = (Me.Height - 60) \ 100
For i = 1 To n
x = 60
For j = 1 To n
If i >= j Then
Flower(x, y)
x = x + 50
End If
Next
y = y + 100
Next
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim x, y, i, n As Integer
g = Me.CreateGraphics
x = 60
y = 60
n = (Me.Height - 60) \ 100
For i = 1 To n
For j = 1 To n
If j = i Then
Flower(x, y)
x = x + 50
End If
Next
y = y + 100
Next
For i = 1 To n
For j = 1 To n
If j = n - i - 1 Then
Flower(x, y)
End If
Next
y = y + 100
Next
End Sub
End Class
Imports System.Drawing
Public Class Form1
Dim g As Graphics
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i, j, n, h, R As Integer
Dim x, y, fi As Single
g = Me.CreateGraphics
n = Val(InputBox(" Kolichesvo svetov"))
h = Me.Height / n
R = 100
fi = 0
For i = 1 To n
x = Me.Width \ 2 + R * Math.Cos(fi)
y = Me.Height \ 2 + R * Math.Sin(fi)
Svetok(x, y, h)
fi = fi + (Math.PI * 2) / n
Next
End Sub
Private Sub Svetok(ByVal x As Integer, ByVal y As Integer, ByVal h As Integer)
Dim kist As New SolidBrush(Color.Green)
Dim x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6, x7, y7, h1 As Integer
Dim list(2) As Point
list(0).X = x + h / 2
list(0).Y = y + h
list(1).X = x + (h / 2)
list(1).Y = y + (h / 4) * 3
list(2).X = x + (h / 4) * 3
list(2).Y = y + (h / 3) * 2
g.FillPolygon(kist, list)
x1 = x + h / 2 : y1 = y + h / 2 : x2 = x + h / 2 : y2 = y + h
Dim pero As New Pen(Color.Green)
g.DrawLine(pero, x1, y1, x2, y2)
kist.Color = Color.Red
x3 = x + (h / 4) : y3 = y + h / 8
h1 = h / 2
g.FillEllipse(kist, x3, y3, 10, 10)
x4 = x + (h / 2) : y4 = y + h / 8
g.FillEllipse(kist, x4, y4, 10, 10)
x5 = x + (h / 4) : y5 = y + (h / 8) * 3
g.FillEllipse(kist, x5, y5, 10, 10)
x6 = x + (h / 2) : y6 = y + (h / 8) * 3
g.FillEllipse(kist, x6, y6, 10, 10)
x7 = x + (h / 8) * 3 : y7 = y + (h / 4)
kist.Color = Color.Yellow
g.FillEllipse(kist, x7, y7, 10, 10)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim i, j, n, h, x, y As Integer
g = Me.CreateGraphics
n = Val(InputBox(" Kolichesvo svetov"))
h = Me.Height / n
For i = 1 To n
x = 0
For j = 1 To n
If i >= j Then Svetok(x, y, h)
x = x + h
Next
y = y + h
Next
End Sub
End Class
Public Class Form1
Dim g As Graphics
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i, n, x, y As Integer
Dim kist1 As New SolidBrush(Color.LightGreen)
g = Me.CreateGraphics
g.FillRectangle(kist1, 0, 0, Me.Width, Me.Height)
x = 60
y = 60
n = (Me.Height - 60) \ 100
For i = 1 To n
Flower(x, y)
y = y + 100
Next
End Sub
Private Sub Flower(ByVal x As Integer, ByVal y As Integer)
Dim kist1 As New SolidBrush(Color.Yellow)
g.FillEllipse(kist1, x, y - 10, 20, 20)
g.FillEllipse(kist1, x - 10, y, 20, 20)
g.FillEllipse(kist1, x, y + 10, 20, 20)
g.FillEllipse(kist1, x + 10, y, 20, 20)
kist1.Color = Color.Red
g.FillEllipse(kist1, x, y, 20, 20)
Dim pero1 As New Pen(Color.Green, 4)
g.DrawLine(pero1, x + 10, y + 30, x + 10, y + 70)
Dim List() As Point = {New Point(x + 10, y + 40), New Point(x + 10, y + 60), New Point(x + 20, y + 35)}
kist1.Color = Color.Green
g.FillPolygon(kist1, List)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim x, y, fi, r As Single, i, n As Integer
g = Me.CreateGraphics()
r = 100
n = Val(InputBox("Введите количество цветочков"))
fi = 0
For i = 1 To n
x = Me.Width \ 2 + r * Math.Cos(fi)
y = Me.Height \ 2 + r * Math.Sin(fi)
Flower(x, y)
fi = fi + (Math.PI * 2) / n
Next
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim x, y, i, n As Integer
g = Me.CreateGraphics
x = 60
y = 60
n = (Me.Height - 60) \ 100
For i = 1 To n
x = 60
For j = 1 To n
If i >= j Then
Flower(x, y)
x = x + 50
End If
Next
y = y + 100
Next
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim x, y, i, n As Integer
g = Me.CreateGraphics
x = 60
y = 60
n = (Me.Height - 60) \ 100
For i = 1 To n
For j = 1 To n
If j = i Then
Flower(x, y)
x = x + 50
End If
Next
y = y + 100
Next
For i = 1 To n
For j = 1 To n
If j = n - i - 1 Then
Flower(x, y)
End If
Next
y = y + 100
Next
End Sub
End Class
Public Class Form1
Dim g As Graphics
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i, n, x, y As Integer
Dim kist1 As New SolidBrush(Color.LightGreen)
g = Me.CreateGraphics
g.FillRectangle(kist1, 0, 0, Me.Width, Me.Height)
x = 60
y = 60
n = (Me.Height - 60) \ 100
For i = 1 To n
Flower(x, y)
y = y + 100
Next
End Sub
Private Sub Flower(ByVal x As Integer, ByVal y As Integer)
Dim kist1 As New SolidBrush(Color.Yellow)
g.FillEllipse(kist1, x, y - 10, 20, 20)
g.FillEllipse(kist1, x - 10, y, 20, 20)
g.FillEllipse(kist1, x, y + 10, 20, 20)
g.FillEllipse(kist1, x + 10, y, 20, 20)
kist1.Color = Color.Red
g.FillEllipse(kist1, x, y, 20, 20)
Dim pero1 As New Pen(Color.Green, 4)
g.DrawLine(pero1, x + 10, y + 30, x + 10, y + 70)
Dim List() As Point = {New Point(x + 10, y + 40), New Point(x + 10, y + 60), New Point(x + 20, y + 35)}
kist1.Color = Color.Green
g.FillPolygon(kist1, List)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim x, y, fi, r As Single, i, n As Integer
g = Me.CreateGraphics()
r = 100
n = Val(InputBox("Введите количество цветочков"))
fi = 0
For i = 1 To n
x = Me.Width \ 2 + r * Math.Cos(fi)
y = Me.Height \ 2 + r * Math.Sin(fi)
Flower(x, y)
fi = fi + (Math.PI * 2) / n
Next
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim x, y, i, n As Integer
g = Me.CreateGraphics
x = 60
y = 60
n = (Me.Height - 60) \ 100
For i = 1 To n
x = 60
For j = 1 To n
If i >= j Then
Flower(x, y)
x = x + 50
End If
Next
y = y + 100
Next
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim x, y, i, n As Integer
g = Me.CreateGraphics
x = 60
y = 60
n = (Me.Height - 60) \ 100
For i = 1 To n
For j = 1 To n
If j = i Then
Flower(x, y)
x = x + 50
End If
Next
y = y + 100
Next
For i = 1 To n
For j = 1 To n
If j = n - i - 1 Then
Flower(x, y)
End If
Next
y = y + 100
Next
End Sub
End Class
Private Sub Flower(ByVal x As Integer, ByVal y As Integer)
Dim kist1 As New SolidBrush(Color.Yellow)
Dim kist2 As New SolidBrush(Color.White)
Dim kist3 As New SolidBrush(Color.Red)
Dim kist4 As New SolidBrush(Color.RosyBrown)
g.FillEllipse(kist1, x, y, 20, 20)
g.FillEllipse(kist2, x - 5, y + 10, 20, 20)
g.FillEllipse(kist3, x + 5, y + 10, 20, 20)
g.FillPie(kist4, x - 20, y + 70, 60, 30, 180, 180)
kist1.Color = Color.Red
Dim pero1 As New Pen(Color.Green, 4)
g.DrawLine(pero1, x + 10, y + 30, x + 10, y + 70)
Dim List() As Point = {New Point(x + 10, y + 40), New Point(x + 10, y + 60), New Point(x + 20, y + 35)}
kist1.Color = Color.Green
g.FillPolygon(kist1, List)
End Sub
Private Sub Flower(ByVal x As Integer, ByVal y As Integer)
Dim kist1 As New SolidBrush(Color.Yellow)
Dim kist2 As New SolidBrush(Color.White)
Dim kist3 As New SolidBrush(Color.Red)
Dim kist4 As New SolidBrush(Color.RosyBrown)
g.FillEllipse(kist1, x, y, 20, 20)
g.FillEllipse(kist2, x - 5, y + 10, 20, 20)
g.FillEllipse(kist3, x + 5, y + 10, 20, 20)
g.FillPie(kist4, x - 20, y + 70, 60, 30, 180, 180)
kist1.Color = Color.Red
Dim pero1 As New Pen(Color.Green, 4)
g.DrawLine(pero1, x + 10, y + 30, x + 10, y + 70)
Dim List() As Point = {New Point(x + 10, y + 40), New Point(x + 10, y + 60), New Point(x + 20, y + 35)}
kist1.Color = Color.Green
g.FillPolygon(kist1, List)
End Sub
Private Sub Flower(ByVal x As Integer, ByVal y As Integer)
Dim kist1 As New SolidBrush(Color.Yellow)
Dim kist2 As New SolidBrush(Color.White)
Dim kist3 As New SolidBrush(Color.Red)
Dim kist4 As New SolidBrush(Color.RosyBrown)
g.FillEllipse(kist1, x, y, 20, 20)
g.FillEllipse(kist2, x - 5, y + 10, 20, 20)
g.FillEllipse(kist3, x + 5, y + 10, 20, 20)
g.FillPie(kist4, x - 20, y + 70, 60, 30, 180, 180)
kist1.Color = Color.Red
Dim pero1 As New Pen(Color.Green, 4)
g.DrawLine(pero1, x + 10, y + 30, x + 10, y + 70)
Dim List() As Point = {New Point(x + 10, y + 40), New Point(x + 10, y + 60), New Point(x + 20, y + 35)}
kist1.Color = Color.Green
g.FillPolygon(kist1, List)
End Sub
Private Sub Flower(ByVal x As Integer, ByVal y As Integer)
Dim kist1 As New SolidBrush(Color.Yellow)
Dim kist2 As New SolidBrush(Color.White)
Dim kist3 As New SolidBrush(Color.Red)
Dim kist4 As New SolidBrush(Color.RosyBrown)
g.FillEllipse(kist1, x, y, 20, 20)
g.FillEllipse(kist2, x - 5, y + 10, 20, 20)
g.FillEllipse(kist3, x + 5, y + 10, 20, 20)
g.FillPie(kist4, x - 20, y + 70, 60, 30, 180, 180)
kist1.Color = Color.Red
Dim pero1 As New Pen(Color.Green, 4)
g.DrawLine(pero1, x + 10, y + 30, x + 10, y + 70)
Dim List() As Point = {New Point(x + 10, y + 40), New Point(x + 10, y + 60), New Point(x + 20, y + 35)}
kist1.Color = Color.Green
g.FillPolygon(kist1, List)
End Sub
Module Module1
Public g As Graphics
Public Sub par(ByVal x As Integer, ByVal y As Integer, ByVal h As Integer)
Dim p As New Pen(Color.Blue)
Dim br As New SolidBrush(Color.Green)
g.FillRectangle(br, x, y, h, h)
g.DrawRectangle(p, x, y, h, h)
End Sub
End Module
Dim a, b As Single
Dim x, y, h, h1 As Integer
g = Me.CreateGraphics
a = Me.ClientSize.Width
b = Me.ClientSize.Height
x = Val(InputBox("x="))
y = Val(InputBox("y="))
h = Val(InputBox("h="))
h1 = Val(InputBox("h1="))
par(x, y, h, h1)
(Прямоугольник)
расположить по порядку
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x, y, h, i, n, j As Integer
g = Me.CreateGraphics
n = Val(InputBox("n="))
h = Me.ClientSize.Height \ n
y = 0
For i = 1 To n
x = 0
For j = 1 To n
par(x, y, h)
x = x + h
Next
y = y + h
Next
End Sub
End Class
Module Module1
Public g As Graphics
Public Sub grib(ByVal x As Integer, ByVal y As Integer, ByVal w As Integer, ByVal h As Integer, ByVal st As Integer, ByVal cent As Integer)
Dim p As New Pen(Color.Black)
Dim br As New SolidBrush(Color.Red)
Dim h1, x1, y1 As Integer
g.DrawPie(p, x, y, w, h, st, cent)
br.Color = Color.Yellow
g.FillEllipse(br, x1, y1, h1, h1)
g.DrawEllipse(p, x1, y1, h1, h1)
End Sub
End Module
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i, j, n As Integer
Dim h, x, y, w, st, cent As Integer
Dim h1, x1, y1 As Integer
g = Me.CreateGraphics
n = Val(InputBox("redi="))
w = Val(InputBox("w="))
cent = Val(InputBox("cent="))
st = Val(InputBox("st="))
h = Me.ClientSize.Height \ n
h1 = Me.ClientSize.Height \ n
x1 = Val(InputBox("x1="))
y1 = Val(InputBox("y1="))
y = 0
For i = 1 To n
x = 0
For j = 1 To n
grib(x, y, h, w, st, cent)
x = x + h
Next
y = y + h
Next
End Sub
End Class
Dim i, s, n, w, xg, yg, hp, xp(), yp(), a, cent, st, h As Integer
g = Me.CreateGraphics
w = Val(InputBox("w="))
n = w - 1
cent = Val(InputBox("cent="))
st = Val(InputBox("st="))
h = Me.ClientSize.Height \ n
yg = Me.ClientSize.Height
xg = Me.ClientSize.Width
a = 50
hp = yg \ (n * 5)
ReDim Preserve xp(n - 1)
For i = 1 To n
xp(i) = a + i * (xg - 2 * a)
grib(xp(i), a + hp \ 3, hp, w, cent, st)
grib(xp(i), yg - a - hp + hp \ 3, hp, w, cent, st)
Next
ReDim Preserve yp(n - 1)
s = a + (xg - 2 * a)
For i = 0 To n
yp(i) = a + hp \ 3 + i * (yg - 2 * a) \ n
grib(a, yp(i), hp, w, st, cent)
grib(s, yp(i), hp, w, st, cent)
Next
grib(s, yg - a - hp + hp \ 3, hp, w, st, cent)
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i, j, n As Integer
Dim h, x, y, w, st, cent As Integer
Dim h1 As Integer
g = Me.CreateGraphics
n = Val(InputBox("redi="))
w = Val(InputBox("w="))
cent = Val(InputBox("cent="))
st = Val(InputBox("st="))
h = Me.ClientSize.Height \ n
h1 = Me.ClientSize.Height \ n
y = 0
For i = 1 To Me.ClientSize.Width \ h - 1
x = 0
For j = 1 To n
grib(x, y, h, w, st, cent)
x = x + h
Next
y = y + h
Next
End Sub
End Class
Module Module1
Public g As Graphics
Public Sub grib(ByVal x As Integer, ByVal y As Integer, ByVal w As Integer, ByVal h As Integer, ByVal st As Integer, ByVal cent As Integer)
Dim p As New Pen(Color.Black)
Dim br As New SolidBrush(Color.Red)
g.DrawPie(p, x, y, w, h, st, cent)
g.FillPie(br, x, y, w, h, st, cent)
br.Color = Color.Yellow
g.FillEllipse(br, x + h \ 2 - 8, y + h \ 2, h \ 2, h)
g.DrawEllipse(p, x + h \ 2 - 8, y + h \ 2, h \ 2, h)
End Sub
End Module
Module Module1
Public g As Graphics
Public Sub par(ByVal x As Integer, ByVal y As Integer, ByVal h As Integer)
Dim p As New Pen(Color.Blue)
Dim br As New SolidBrush(Color.Green)
g.FillRectangle(br, x, y, h, h)
g.DrawRectangle(p, x, y, h, h)
End Sub
End Module
Dim a, b As Single
Dim x, y, h, h1 As Integer
g = Me.CreateGraphics
a = Me.ClientSize.Width
b = Me.ClientSize.Height
x = Val(InputBox("x="))
y = Val(InputBox("y="))
h = Val(InputBox("h="))
h1 = Val(InputBox("h1="))
par(x, y, h, h1)
(Прямоугольник)
расположить по порядку
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x, y, h, i, n, j As Integer
g = Me.CreateGraphics
n = Val(InputBox("n="))
h = Me.ClientSize.Height \ n
y = 0
For i = 1 To n
x = 0
For j = 1 To n
par(x, y, h)
x = x + h
Next
y = y + h
Next
End Sub
End Class
Module Module1
Public g As Graphics
Public Sub grib(ByVal x As Integer, ByVal y As Integer, ByVal w As Integer, ByVal h As Integer, ByVal st As Integer, ByVal cent As Integer)
Dim p As New Pen(Color.Black)
Dim br As New SolidBrush(Color.Red)
Dim h1, x1, y1 As Integer
g.DrawPie(p, x, y, w, h, st, cent)
br.Color = Color.Yellow
g.FillEllipse(br, x1, y1, h1, h1)
g.DrawEllipse(p, x1, y1, h1, h1)
End Sub
End Module
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i, j, n As Integer
Dim h, x, y, w, st, cent As Integer
Dim h1, x1, y1 As Integer
g = Me.CreateGraphics
n = Val(InputBox("redi="))
w = Val(InputBox("w="))
cent = Val(InputBox("cent="))
st = Val(InputBox("st="))
h = Me.ClientSize.Height \ n
h1 = Me.ClientSize.Height \ n
x1 = Val(InputBox("x1="))
y1 = Val(InputBox("y1="))
y = 0
For i = 1 To n
x = 0
For j = 1 To n
grib(x, y, h, w, st, cent)
x = x + h
Next
y = y + h
Next
End Sub
End Class
Dim i, s, n, w, xg, yg, hp, xp(), yp(), a, cent, st, h As Integer
g = Me.CreateGraphics
w = Val(InputBox("w="))
n = w - 1
cent = Val(InputBox("cent="))
st = Val(InputBox("st="))
h = Me.ClientSize.Height \ n
yg = Me.ClientSize.Height
xg = Me.ClientSize.Width
a = 50
hp = yg \ (n * 5)
ReDim Preserve xp(n - 1)
For i = 1 To n
xp(i) = a + i * (xg - 2 * a)
grib(xp(i), a + hp \ 3, hp, w, cent, st)
grib(xp(i), yg - a - hp + hp \ 3, hp, w, cent, st)
Next
ReDim Preserve yp(n - 1)
s = a + (xg - 2 * a)
For i = 0 To n
yp(i) = a + hp \ 3 + i * (yg - 2 * a) \ n
grib(a, yp(i), hp, w, st, cent)
grib(s, yp(i), hp, w, st, cent)
Next
grib(s, yg - a - hp + hp \ 3, hp, w, st, cent)
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i, j, n As Integer
Dim h, x, y, w, st, cent As Integer
Dim h1 As Integer
g = Me.CreateGraphics
n = Val(InputBox("redi="))
w = Val(InputBox("w="))
cent = Val(InputBox("cent="))
st = Val(InputBox("st="))
h = Me.ClientSize.Height \ n
h1 = Me.ClientSize.Height \ n
y = 0
For i = 1 To Me.ClientSize.Width \ h - 1
x = 0
For j = 1 To n
grib(x, y, h, w, st, cent)
x = x + h
Next
y = y + h
Next
End Sub
End Class
Module Module1
Public g As Graphics
Public Sub grib(ByVal x As Integer, ByVal y As Integer, ByVal w As Integer, ByVal h As Integer, ByVal st As Integer, ByVal cent As Integer)
Dim p As New Pen(Color.Black)
Dim br As New SolidBrush(Color.Red)
g.DrawPie(p, x, y, w, h, st, cent)
g.FillPie(br, x, y, w, h, st, cent)
br.Color = Color.Yellow
g.FillEllipse(br, x + h \ 2 - 8, y + h \ 2, h \ 2, h)
g.DrawEllipse(p, x + h \ 2 - 8, y + h \ 2, h \ 2, h)
End Sub
End Module
Dim g As Graphics
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i, j, n, m, x, y As Integer
g = Me.CreateGraphics
фон()
y = 10 : x = 30
m = (Me.Height - 10) \ 75
n = (Me.Width - 10) \ (30 + 45)
For i = 1 To m
If i Mod 2 <> 0 Then
x = 30
Else
x = 68
End If
For j = 1 To n
гриб(x, y)
x = x + 75
Next
y = y + 75
Next
End Sub
Private Sub фон()
Dim кисть1 As New SolidBrush(Color.Bisque)
g.FillRectangle(кисть1, 0, 0, Me.Width, Me.Height)
End Sub
Private Sub гриб(ByVal x As Integer, ByVal y As Integer)
Dim кисть As New SolidBrush(Color.ForestGreen)
g.FillEllipse(кисть, x, y, 30, 60)
Dim кисть1 As New SolidBrush(Color.PaleVioletRed)
g.FillPie(кисть1, x - 15, y, 60, 60, 180, 180)
End Sub
все в форме
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i, j, x, y As Integer, m, n As Integer
g = Me.CreateGraphics
y = 30
x = 10
m = (Me.Height - 30) \ 50
n = (Me.Width - 10) \ 25
For i = 1 To m
x = 10
For j = 1 To n
If i >= j Then
flower(x, y)
x = x + 50
End If
Next
y = y + 50
Next
End Sub
End Class
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i, j, x, y As Integer, m, n As Integer
g = Me.CreateGraphics
y = 30
x = 10
m = (Me.Height - 30) \ 50
n = (Me.Width - 10) \ 25
For i = 1 To m
x = 10
If i Mod 2 <> 0 Then
x = 10
Else
x = 40
End If
For j = 1 To n
flower(x, y)
x = x + 50
Next
y = y + 50
Next
End Sub