Larazus开发计算器
2015-10-13 16:53
260 查看
unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,Math; type { TForm1 } TForm1 = class(TForm) Button1: TButton; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; RadioButton1: TRadioButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; RadioButton4: TRadioButton; procedure Button1Click(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject); var a,b,c:double; result:string; begin val(edit1.Text,a); val(edit2.Text,b); if radiobutton1.Checked=true then begin c:=a+b end; if radiobutton2.Checked=true then begin c:=a-b end; if radiobutton3.Checked=true then begin c:=a*b end; if radiobutton4.Checked=true then begin c:=a/b end; result:=formatfloat('0.00',c); //str(c,result); edit3.Text:=result; end; end.
相关文章推荐
- crmjs脚步获取服务器时间
- 猴子选大王 php
- python多线程编程(二)--threading模块
- Flume1.5.0的安装、部署、简单应用(含伪分布式、与hadoop2.2.0、hbase0.96的案例)
- 设置文本字体大小
- JS中A标签模拟POST请求
- PHP图片处理---画各种图像
- ZOJ 1649 Rescue(BFS)
- #!/bin/bash
- SVN无法提交代码或者代码被锁定
- 二分查找算法 php
- MFC工程 vs2008 C++编译JSONCPP 静态库
- Android中CSS设置select高度的bug解决方法及jq操作select
- 韩顺平 java 第40讲 线程同步
- java入门第四天 游戏准备 跳来跳去 的小球
- Week1-2Examples of text
- Android 6.0 Doze 和 App Standby 关于功耗的优化--翻译1
- 修复 OneNote 截屏 快捷键
- Hbase shell
- 图的遍历之深度优先搜索