❶ 用idea怎麼製作愛心符號
idea愛心符號代碼需要用start命令打
1,windowsxp用start命令運行,輸入start,可以獲得該命令的使好銀用幫助。
2,在windows XP的命令提示符中輸入:start、seperate要運行的程序,即可運行相應的DOS程序,這就是idea愛心晌游代碼友謹宴打法。
❷ c語言的愛心代碼
愛心代碼慧磨編程:
#include <stdio.h>
int main(void)
{
float a,x,y;
for(y=1.5f; y>-1.5f; y-=0.1f)
{
for(x=-1.5f; x<1.5f; x+=0.05f)
{
a = x*x+y*y-1;
char ch = a*a*a-x*x*y*y*y<=0.0f?'*':' ';
putchar(ch);
}
printf(" ");
}
return 0;
}
書寫規則
1、一個說明或一個語句佔一行。
2、用{} 括起來的部分,通常表示了程序的某一層次結構。{}一般與該結構語句的第一個字母對齊,並單獨佔一前敗斗行。
3、低一層次的語句或說明可比高一層次的語句或說明縮進若干格後書寫。以便看起來更加清枯賣晰,增加程序的可讀性。在編程時應力求遵循這些規則,以養成良好的編程風格。
❸ 用VB程序怎麼做一個心型圖
Dim X1, Y1, X2, Y2 As Integerx0dx0aDim I As Integerx0dx0aDim J As Booleanx0dx0aDim K As IntegerDim WithEvents Label1 As Labelx0dx0aDim WithEvents Timer1 As TimerPrivate Sub Form_Activate()x0dx0a I = 100x0dx0a K = 100x0dx0a X1 = Me.Width / 2x0dx0a Y1 = Me.Height / 3x0dx0a X2 = X1x0dx0a Y2 = Y1x0dx0aLabel1.Top = Me.Height / 2 - Label1.Height / 2x0dx0a Label1.Left = Me.Width / 2 - Label1.Width / 2x0dx0aEnd SubPrivate Sub Form_Load() Me.BackColor = &H0&x0dx0a Me.FillColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)x0dx0a Me.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)x0dx0a Me.DrawMode = 13x0dx0a Me.DrawWidth = 2x0dx0a Me.FillStyle = 7x0dx0aSet Label1 = Me.Controls.Add("VB.Label", "Label1")x0dx0a Set Timer1 = Me.Controls.Add("VB.Timer", "Timer1")x0dx0aLabel1.Visible = Truex0dx0a Label1.AutoSize = Truex0dx0a Label1.BackStyle = 0x0dx0a Label1.Caption = "I LOVE YOU"x0dx0a Label1.Font.Size = 60x0dx0a Label1.ForeColor = &HFF00&x0dx0a Timer1.Enabled = Truex0dx0a Timer1.Interval = 10x0dx0a Me.WindowState = 2x0dx0aEnd SubPrivate Sub Timer1_Timer()x0dx0a Me.Circle (X1, Y1), 250x0dx0a Me.Circle (X2, Y2), 250x0dx0a x0dx0a If Y1 <= Me.Height - 1200 Thenx0dx0a X1 = X1 + Kx0dx0a Y1 = Y1 - Ix0dx0a X2 = X2 - Kx0dx0a Y2 = Y2 - Ix0dx0a I = I - 2x0dx0a If Y1 <= Me.Height / 3 Thenx0dx0a K = K - 1x0dx0a ElseIf Y1 >= Me.Height / 3 Thenx0dx0a K = K - 5x0dx0a End Ifx0dx0a Elsex0dx0a I = 100x0dx0a K = 100x0dx0a X1 = Me.Width / 2x0dx0a Y1 = Me.Height / 3x0dx0a X2 = X1x0dx0a Y2 = Y1x0dx0a x0dx0a Me.FillColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)x0dx0a Me.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255) End Ifx0dx0a x0dx0a Me.DrawWidth = 3x0dx0a x0dx0a Me.PSet (Rnd * Me.Width, Rnd * Me.Height), RGB(Rnd * 225, Rnd * 225, Rnd * 225)x0dx0a Me.DrawWidth = 2x0dx0aEnd SubPrivate Sub Form_Click()x0dx0a Endx0dx0aEnd SubPrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)x0dx0a Endx0dx0aEnd Sub