dkfr.net
当前位置:首页 >> 计算器代码 >>

计算器代码

#include void js(float *i,int j,char c) { float m; scanf("%f",&m); if(c=='*') i[j]=i[j]*m; else i[j]=i[j]/m; } void js2(float *i,char *c,int j,int k) { for(;j>0;j--,k--) { if(c[k]=='+') i[j-1]=i[j-1]+i[j]; else i[j-1]=i[j-1]-i[...

JS版计算器 /* 定义一个Calculator类*/ function Calculator(){ this.jisuan=function(num1,num2,oper){ var res=0; switch(oper){ case "+": res=num1+num2; break; case "-": res=num1-num2; break; case "*": res=num1*num2; break; case "/"...

/* * @(#)JCalculator.java 1.00 12/29/2009 * * Email: light_warm@163.com */ import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * A simple calculator program. * I saw this program in a QQ group, and help a frie...

public class SanJiao {public static void main(String[] args) {double a = Math.toRadians(90);//把数字90 转换成 90度System.out.println(Math.sin(a));//计算sin 90度double b = Math.toRadians(30);System.out.println(Math.cos(b));doubl...

// 定义实例变量decimal result char operator 数字的代码 if flag=0 then sle_1.text="" flag=1 end if sle_1.text=sle_1.text+this.text 运算符的代码 choose case operator case '×' sle_1.text=string(dec(sle_1.text)*result) case '÷' sle...

计算器 function add(obj) { document.getElementById("txt1").value+=obj.value; } function results() { var obj=document.getElementById("txt1").value; if(obj.indexOf("=")

这是去年我的期末作业,发给你吧。 import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.*; public class Calculate extends JFrame { private String front = "", behind = ""; //分别用于记录加减乘除运算符之...

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Button4: TButton...

是用awt和swing做的,很好看比单单用AWT做好看 import java.awt.*; import javax.swing.*; public class Conputer extends JFrame { protected Container con = getContentPane();// 指向内容面板 protected JMenuBar a = new JMenuBar();// 菜...

#include int main(){ double a,b,r; char c; scanf("%lf %c %lf",&a,&c,&b); switch(c){ case '+': r = a + b; break; case '-': r = a - b; break; case '*': r = a * b; break; case '/': r = a / b; break; default: r = 0; } printf("%lf %...

网站首页 | 网站地图
All rights reserved Powered by www.dkfr.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com