c语言程序设计英文版
1. c语言程序设计 (英文打字练习)
Option Explicit
Dim speed, right, wrong, keynum As Integer '定义速度,正确次数,错误次数,击键次数
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1
Dim rtn As LongSub letterInit() '初始化每个字母
lbl_letter.Caption = Chr(Int(Rnd * 26) + 97) '随机产生字母,如果要产生大写字母只要把97改成65即可
speed = Int(Rnd * 100 + 200)
lbl_letter.Left = Int(Rnd * (Form1.Width - lbl_letter.Width)) '随机产生字母出现的位置
lbl_letter.Top = lbl_score.Height
End SubPrivate Sub Command1_Click()
letterInit
lbl_score.Caption = "成绩: " & 0 & " 分" & " 错误: " & 0 & " 个" & " 正确率: " & 0 & "%"
Timer1.Enabled = True '启动定时器
Timer2.Enabled = True
Timer1.Interval = 100
Timer2.Interval = 1000
'隐藏命令按钮
Command1.Visible = False
Command2.Visible = False
lbl_time.Caption = 120 & " 秒"
End SubPrivate Sub Command2_Click()
Unload Me
End SubPrivate Sub Form_KeyPress(KeyAscii As Integer)
keynum = keynum + 1 If Chr(KeyAscii) = lbl_letter.Caption Then '判断所按键位是否与产生的字母相符
letterInit
rtn = sndPlaySound(App.Path & "\right.wav", SND_ASYNC)
right = right + 1
Else
rtn = sndPlaySound(App.Path & "\wrong.wav", SND_ASYNC)
wrong = wrong + 1
End If
lbl_score.Caption = "成绩: " & right & "分" & " 错误: " & wrong & " 个" & " 正确率: " & Int(right / keynum * 100) & "%" If KeyAscii = 27 Then
Timer1.Enabled = False
Timer2.Enabled = False
lbl_score.BackColor = vbYellow
lbl_score.Caption = "成绩: " & right & "分" & " 错误: " & wrong & " 个" & " 正确率: " & Int(right / keynum * 100) & "%" & " 按任意键继续"
Else
lbl_score.BackColor = vbGreen
Timer1.Enabled = True
Timer2.Enabled = True
End If
End SubPrivate Sub Form_Load()
Form1.Left = (Screen.Width - Form1.Width) / 2
Form1.Top = (Screen.Height - Form1.Height) / 2
Form1.BorderStyle = 1
Form1.BackColor = vbBlack
Form1.Caption = "英文打字练习程序"
Command1.Default = True
Command1.Caption = "开始"
Command2.Caption = "退出"
'设置lbl_letter中显示的字符的字体、样式、字号,请同时调整lbl_letter的大小与字符大小相等
With lbl_letter.Font
.Name = "宋体"
.Size = 20
.Bold = True
End With
lbl_letter.ForeColor = vbYellow
lbl_letter.BackColor = Form1.BackColor
lbl_score.BackColor = vbGreen
lbl_score.Alignment = 0
lbl_score.Caption = "敲回车键开始打字练习,按ESC键暂停"
lbl_time.BackColor = lbl_score.BackColor
lbl_time.Alignment = 2
lbl_time.Caption = "时间120秒"
Timer1.Enabled = False
Timer2.Enabled = False
Randomize '初始化
End SubPrivate Sub Timer1_Timer()
lbl_letter.Top = lbl_letter.Top + speed
If lbl_letter.Top >= Form1.Height Then
letterInit
End If
End Sub Private Sub Timer2_Timer()
lbl_time.Caption = Val(lbl_time.Caption) - 1 & " 秒"
If Val(lbl_time.Caption) <= 0 Then '判断时间是否已经用完
Timer1.Enabled = False
Timer2.Enabled = False
lbl_letter.Caption = ""
Select Case (right * (right / keynum))
Case Is <= 80
MsgBox "成绩: 不及格! 不过别灰心,请多多练习!", vbOKOnly, "练习结束!"
Case Is <= 100
MsgBox "成绩: 及格! 还要继续加油努力啊!", vbOKOnly, "练习结束!"
Case Is <= 120
MsgBox "成绩: 良!再加加油你就可以成为高手了!", vbOKOnly, "练习结束!"
Case Is >= 150
MsgBox "成绩: 优秀! 太棒了,恭喜你再也不会为打字发愁了!", vbOKOnly, "练习结束!"
End Select Command1.Visible = True '命令按钮恢复为可见状态
Command2.Visible = True
right = 0
wrong = 0
keynum = 0
End If
End Sub哥哥帮你,对你好吧!也不搞点分来啊
2. C语言程序设计哪些编程软件适合初学者
初学者建议学习中文版的编程软件,因为英文版的什么也看不懂。目前我一直用的是c++6.0中文企业版的,简单易上手,C语言代码,c++的代码都可以编译。
1、Micosoft visual C++,经典推荐。
2、TC,学校推荐。
3、DEV C++,个人推荐。
4、C-FREE,国人自己做的。
5、turbo c 3.0,新人推荐。
6、ANSI C。
C与C++的区别:C语言是面向过程的编程语言,C++是面向对象的编程语言。
3. C语言程序设计用英语怎么说
C Programming Language
C语言是一种通用的编程语言,广泛用于系统软件与应用软件的开发。于1969年至1973年间,为了移植与开发UNIX操作系统,由丹尼斯·里奇与肯·汤普逊,以B语言为基础,在贝尔实验室设计、开发出来。
C语言具有高效、灵活、功能丰富、表达力强和较高的可移植性等特点,在程序设计中备受青睐,成为最近25年使用最为广泛的编程语言[2]。当前,C语言编译器普遍存在于各种不同的操作系统中,例如Microsoft Windows、macOS、Linux、Unix等。C语言的设计影响了众多后来的编程语言,例如C++、Objective-C、Java、C#等。
(3)c语言程序设计英文版扩展阅读:
C语言诞生于美国的贝尔实验室,由D.M.Ritchie以B语言为基础发展而来,在它的主体设计完成后,Thompson和Ritchie用它完全重写了UNIX,且随着UNIX的发展,c语言也得到了不断的完善。为了利于C语言的全面推广,许多专家学者和硬件厂商联合组成了C语言标准委员会,并在之后的1989年,诞生了第一个完备的C标准,简称“C89”,也就是“ANSI c”,截至2020年,最新的C语言标准为2017年发布的 “C17”。