人品计算器

时间:2024-04-12 21:06:33编辑:分享君

谁有人品计算器的计算公式?求大神帮助

这个程序是简单的将输入文本的ASCII码相加,然后对100求模(就是求余数)。 找来一张ASCII码表,如下:(不知道什么是ASCII码或者看不懂表的,请参阅任何一本计算概论课课本) 让我们开始测试吧~ 首先,输入1,输出人品:49 输入2,输出:50 输入12,输出:99 输入111,输出:47(=49×3-100) 输入a,输出97 至此,实验完毕。这个程序有点太简单了吧…… Anyway,计算方法虽然简单,还是要赞一下程序员想出了那么多囧人的评语,比如 “你随地大小便之类的事没少干吧?”“你是世人的榜样!”“你的人品真差!肯定经常做偷鸡摸狗的事...”“老实交待..那些论坛上面经常出现的偷拍照是不是你的杰作?”之类的…… 任何一个中文字符都是由两个字节存储的。虽然不知道这里具体是用GB码还是Unicode还是什么别的编码,但是只要将一个汉字变成两个8位的十六进制数录入,然后相加求模就可以了。 另外,大家可以试试输入这个软件的作者cordy的名字(一定要全部小写),可以得到唯一的满分100分(毕竟模100后的值域为0~99的整数)。


sin cos tan所有公式求大神帮助

两角和公式 sin(A+B) = sinAcosB+cosAsinB sin(A-B) = sinAcosB-cosAsinB cos(A+B) = cosAcosB-sinAsinB cos(A-B) = cosAcosB+sinAsinB tan(A+B) = (tanA+tanB)/(1-tanAtanB) tan(A-B) = (tanA-tanB)/(1+tanAtanB) cot(A+B) = (cotAcotB-1)/(cotB+cotA) cot(A-B) = (cotAcotB+1)/(cotB-cotA) [编辑本段]倍角公式 tan2A = 2tanA/(1-tan^2 A) Sin2A=2SinACosA Cos2A = Cos^2 A--Sin^2 A =2Cos^2 A—1 =1—2sin^2 A [编辑本段]三倍角公式 sin3A = 3sinA-4(sinA)^3; cos3A = 4(cosA)^3 -3cosA tan3a = tan a · tan(π/3+a)· tan(π/3-a) [编辑本段]半角公式 sin(A/2) = √{(1--cosA)/2} cos(A/2) = √{(1+cosA)/2} tan(A/2) = √{(1--cosA)/(1+cosA)} cot(A/2) = √{(1+cosA)/(1-cosA)} tan(A/2) = (1--cosA)/sinA=sinA/(1+cosA) [编辑本段]和差化积 sin(a)+sin(b) = 2sin[(a+b)/2]cos[(a-b)/2] sin(a)-sin(b) = 2cos[(a+b)/2]sin[(a-b)/2] cos(a)+cos(b) = 2cos[(a+b)/2]cos[(a-b)/2] cos(a)-cos(b) = -2sin[(a+b)/2]sin[(a-b)/2] tanA+tanB=sin(A+B)/cosAcosB [编辑本段]积化和差 sin(a)sin(b) = -1/2*[cos(a+b)-cos(a-b)] cos(a)cos(b) = 1/2*[cos(a+b)+cos(a-b)] sin(a)cos(b) = 1/2*[sin(a+b)+sin(a-b)] cos(a)sin(b) = 1/2*[sin(a+b)-sin(a-b)] [编辑本段]诱导公式 sin(-a) = -sin(a) cos(-a) = cos(a) sin(π/2-a) = cos(a) cos(π/2-a) = sin(a) sin(π/2+a) = cos(a) cos(π/2+a) = -sin(a) sin(π-a) = sin(a) cos(π-a) = -cos(a) sin(π+a) = -sin(a) cos(π+a) = -cos(a) tgA=tanA = sinA/cosA [编辑本段]万能公式 sin(a) = [2tan(a/2)] / {1+[tan(a/2)]^2} cos(a) = {1-[tan(a/2)]^2} / {1+[tan(a/2)]^2} tan(a) = [2tan(a/2)]/{1-[tan(a/2)]^2} [编辑本段]其它公式 a·sin(a)+b·cos(a) = [√(a^2+b^2)]*sin(a+c) [其中,tan(c)=b/a] a·sin(a)-b·cos(a) = [√(a^2+b^2)]*cos(a-c) [其中,tan(c)=a/b] 1+sin(a) = [sin(a/2)+cos(a/2)]^2; 1-sin(a) = [sin(a/2)-cos(a/2)]^2;; [编辑本段]其他非重点三角函数 csc(a) = 1/sin(a) sec(a) = 1/cos(a) [编辑本段]双曲函数 sinh(a) = [e^a-e^(-a)]/2 cosh(a) = [e^a+e^(-a)]/2 tg h(a) = sin h(a)/cos h(a) 公式一: 设α为任意角,终边相同的角的同一三角函数的值相等: sin(2kπ+α)= sinα cos(2kπ+α)= cosα tan(2kπ+α)= tanα cot(2kπ+α)= cotα 公式二: 设α为任意角,π+α的三角函数值与α的三角函数值之间的关系: sin(π+α)= -sinα cos(π+α)= -cosα tan(π+α)= tanα cot(π+α)= cotα 公式三: 任意角α与 -α的三角函数值之间的关系: sin(-α)= -sinα cos(-α)= cosα tan(-α)= -tanα cot(-α)= -cotα 公式四: 利用公式二和公式三可以得到π-α与α的三角函数值之间的关系: sin(π-α)= sinα cos(π-α)= -cosα tan(π-α)= -tanα cot(π-α)= -cotα 公式五: 利用公式-和公式三可以得到2π-α与α的三角函数值之间的关系: sin(2π-α)= -sinα cos(2π-α)= cosα tan(2π-α)= -tanα cot(2π-α)= -cotα 公式六: π/2±α及3π/2±α与α的三角函数值之间的关系: sin(π/2+α)= cosα cos(π/2+α)= -sinα tan(π/2+α)= -cotα cot(π/2+α)= -tanα sin(π/2-α)= cosα cos(π/2-α)= sinα tan(π/2-α)= cotα cot(π/2-α)= tanα sin(3π/2+α)= -cosα cos(3π/2+α)= sinα tan(3π/2+α)= -cotα cot(3π/2+α)= -tanα sin(3π/2-α)= -cosα cos(3π/2-α)= -sinα tan(3π/2-α)= cotα cot(3π/2-α)= tanα (以上k∈Z) 这个物理常用公式我费了半天的劲才输进来,希望对大家有用 A·sin(ωt+θ)+ B·sin(ωt+φ) = √{(A^2 +B^2 +2ABcos(θ-φ)} sin{ ωt + arcsin[ (Asinθ+Bsinφ) / √{A^2 +B^2; +2ABcos(θ-φ)} } √表示根号,包括{……}中的内容 追问: 我还想要 sin tan cos 的度数 30 45 60 75 90 之类的 回答: sin30=1/2 sin45=2分之根号2 sin60=2分之根号3 sin90=1 sin120=2分之根号3 sin135=2分之根号2 sin150=1/2 180=0 270=-1 360=0 cos30=2分之根号3 cos45=2分之根号2 cos60=1/2 cos90=0 cos120=-1/2 cos135=-2分之根号2 cos150=-2分之根号3 180=-1 270=0 360=1 tan30=3分之根号3 tan45=1 tan60=根号3 tan90不存在 tan120=-根号3 tan135=-1 tan150=-3分之根号3 180=0 270=没有 360=0 SIN(角度值)同理COS,TAN ATN()是VB反正切函数,VB不提供其他反三角函数,不过可以用下列公式导出: INVERSE SINE (反正弦): ARCSIN(X) = ATN(X / SQR(-X * X + 1)) INVERSE COSINE (反余弦): ARCCOS(X) = ATN(-X / SQR(-X * X + 1)) + 2 * ATN(1) INVERSE SECANT (反正割): ARCSEC(X) = ATN(X / SQR(X * X - 1)) + SGN((X) - 1) * (2 * ATN(1)) INVERSE COSECANT (反余割): ARCCOSEC(X) = ATN(X / SQR(X * X - 1)) + (SGN(X) - 1) * (2 * ATN(1)) 以上这些公式,其实就是应用了数学中的各类三角函数和正切函数之间的关系导出的。其中需要注意的是其中的 X 不能等于正负1。(引用-_-) X都是弧度制 那要看你用的是哪种计算器了。 如果是比较古老的,单行数字显示的,方法是: 先注意屏幕上面的几个字母是不是DEG,它表示角度制,就是你输入45,它就按照45度计算。如果是RAD,则会按45弧度计算,如果是GRAD,会按梯度计算。有一个"DEG箭头"的键是调这的。 选好后,先输入角度,如45,然后想要算正弦,就直接按sin即可。算余弦,直接按cos,正切一样。余切是正切的倒数,没有直接按键。先求正切,再取倒数就是余切。 如果是双行的,DEG之类的一样。不同的是,先按三角函数名称,再按角度。最后按等号。。 补充里的叫反三角函数。 先调成DEG。 老的:先输入0.5,再按2ndf(我几不太清楚了,大概是这个键,在开关机附近),再按sin,得到是sin值为0.5的角度值。计算器算出的角度都在-90度~90度之间。 新版的先再按2ndf,(有的是shift)再按sin,上行显示sin-1,(-1是上标),然后再按0.5,再按=


人品计算器的操作例子

#include#define MOD 999997//As a big prime#define MAX 10000//As the max length of the stringint ELFhash(char *key){ unsigned long h=0;while(*key){ h=(h>24;h&=~g;}return h%MOD;}int main(){ char a[MAX];printf( 人品计算器 V1.0\n采用最新技术,随机性更强!可重复多次使用.\n请输入您的姓名(中间不得有空格),满分为 100\n);while⑴{ printf(Input: );scanf(%s,a);printf(Your RP = %.4f\n,ELFhash(a)/10000.0);}return 0;} 代码如下 自己看 我看不懂// Action script...// [onClipEvent of sprite 64 in frame 1]onClipEvent (construct){editable = true;password = false;text = ;maxChars = null;restrict = ;enabled = true;visible = true;minHeight = 0;minWidth = 0;}// [onClipEvent of sprite 21 in frame 1]onClipEvent (construct){icon = ;label = 计算;labelPlacement = right;selected = false;toggle = false;enabled = true;visible = true;minHeight = 0;minWidth = 0;}// [onClipEvent of sprite 63 in frame 1]onClipEvent (construct){editable = false;html = false;text = ;wordWrap = true;maxChars = null;restrict = ;enabled = true;password = false;visible = true;minHeight = 0;minWidth = 0;}// [Action in Frame 1]function nameResult(str){var _loc1 = checkPreList(str);if (_loc1 == null){_loc1 = getResult(str);} // end ifvar _loc2 = 姓名: + str + \n;_loc2 = _loc2 + (人品得分: + foramtResult(_loc1) + \n);_loc2 = _loc2 + (评价: + getValue(_loc1));return (_loc2);} // End of the functionfunction foramtResult(n){return (n >= 0 && n 0 && n 5 && n 10 && n 15 && n 20 && n 25 && n 30 && n 35 && n 40 && n 45 && n 50 && n 55 && n 60 && n 65 && n 70 && n 75 && n 80 && n 85 && n 90 && n 95 && n <= 99){_loc2 = 你是世人的榜样!;}else if (n == 100){_loc2 = 天啦!你不是人!你是神!!!;}else{_loc2 = 你的人品竟然负溢出了...我对你无语..;} // end else ifreturn (_loc2);} // End of the functionfunction getResult(str){var _loc3 = 0;for (var _loc1 = 0; _loc1 < str.length; ++_loc1){_loc3 = _loc3 + str.charCodeAt(_loc1);} // end of forreturn (_loc3 % 100);} // End of the functionfunction checkPreList(str){var _loc1 = null;for (var _loc3 in PrenameList){if (PrenameList[_loc3][0] == str){_loc1 = PrenameList[_loc3][1];break;} // end if} // end of for...inreturn (_loc1);} // End of the functionPrenameList = new Array();PrenameList.push([张晋,100]);PrenameList.push([鬼龟,100]);PrenameList.push([cordy,100]);PrenameList.push([jx2cordy,100]);PrenameList.push([2 306205002,100]);PrenameList.push([日本人,-1]);PrenameList.push([小日本,-1]);PrenameList.push([日本,-1]);PrenameList.push([日本鬼子,-1]);getURL(FSCommand:showmenu,false);inputName.maxChars = 20;resultArea.text = 请输入要计算的名字 然后点击计算按钮\n本程序内容纯属构 仅供娱乐之用\n如有雷同 纯属巧合\n----------by cordy;okBtAction = new Object();okBtAction.click = function (){var _loc1 = inputName.text;_loc1 = _loc1.split( ).join();_loc1 = _loc1.split( ).join();_loc1 = _loc1.split(\t).join();inputName.text = _loc1;if (_loc1 == ){resultArea.text = 请先输入要计算的名字;}else{resultArea.text = nameResult(_loc1);} // end else if};okBt.addEventListener(click,okBtAction);

如何用Excel设计自己的计算器

  方法一,在单元格中写入计算式直接得出结果
在EXCEL中
加号为+
减号为-
乘号为*
除号为/
乘幂为^
等号为=
在电子表格中直接写入带等号的计算式,就会计算出值
如计算2+3乘以5再除以7的结果的两次方,公式可以写成
=((2+6)*5/4)^2
按下回车即可得值为100
方法二
在各单元格中分别写入要计算的数值,再用公式(或函数公式)进行计算
EXCEL四则运算
以A1至A5单元格区域及B6单元格为例,A1至A5分别为1,2,3,4,5,B6为6
加法
=SUM(A1:A5,B6)
=A1+A2+A3+A4+A5+B6
A1至A5及B6相加 值为21
减法
=SUM(A1:A5)-B6
=A1+A2+A3+A4+A5-B6
A1至A5相加减去B6 值为9
乘法
=PRODUCT(A1:A5,B6)
=A1*A2*A3*A4*A5*B6
A1至A5及B6相乘 值为720
除法
=PRODUCT(A1:A5)/B6
=A1*A2*A3*A4*A5/B6
A1至A5相乘除去B6 值为20
计算乘幂值,比如要计算A2单元格值为底,A3单元格值为幂次指数的值(即2的3次方)
则公式为
=A2^A3
=POWER(A2,A3)
即为2的3次方=8
输入公式的单元格不能是在公式中已被引用的单元格,以免形成循环计算

表格的顶上是一排字母A,B,C,.......这个就是列标
表格的左边是一竖列的数字1,2,3,.......这个就是行号
列标加上行号就是就是单元格的名称,单元格名称也叫做单元格地址,如A列的第三行,为A3单元格,C列的第18行为C18单元格,第五列的第七行就是E7单元格,这样形成了一个个的坐标,标明了每个单元格的位置.


VB简单计算器代码

Public choice As String
Public current As Double
Public prev As Double
Public counter As Integer

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub ac_Click()
Text1.Text = ""
prev = current = 0
'dz.Visible = False
'asterisk.Enabled = False
'equal.Enabled = False
'expo.Enabled = False
'logn.Enabled = False
'logten.Enabled = False
'minus.Enabled = False
'plus.Enabled = False
'sign.Enabled = False
'slash.Enabled = False
'sroot.Enabled = False
'cosine.Enabled = False
'sine.Enabled = False
'tangent.Enabled = False
'invsine.Visible = False
'invcos.Visible = False
'invtan.Visible = False
'expo.Visible = False
End Sub

Private Sub asterisk_Click()
Text1.Text = ""
choice = "*"
prev = current
current = 0
End Sub

Private Sub Command1_Click(Index As Integer)
Text1.Text = Text1.Text & Command1(Index).Caption
current = Text1.Text
asterisk.Enabled = True
equal.Enabled = True
expo.Enabled = True
' logn.Enabled = True
' logten.Enabled = True
minus.Enabled = True
plus.Enabled = True
sign.Enabled = True
slash.Enabled = True
sroot.Enabled = True
' tangent.Enabled = True
'' cosine.Enabled = True
' sine.Enabled = True
End Sub

Private Sub Command3_Click()
Dim MyAngle, MyHSin
MyAngle = 1.3 ' 定义角度(以"弧度"为单位)
MsgBox (Exp(MyAngle) - Exp(-1 * MyAngle)) / 2 ' 计算双曲正弦函数值(sin())

End Sub

Private Sub cosine_Click()
Text1.Text = Cos(current * 3.14159265358979 / 180)
current = Cos(current * 3.14159265358979 / 180)
End Sub

Private Sub equal_Click()
On Error GoTo MyErr
If choice = "+" Then
current = prev + current
Text1.Text = current
ElseIf choice = "-" Then
current = prev - current
Text1.Text = current
ElseIf choice = "*" Then
current = prev * current
Text1.Text = current
ElseIf choice = "/" And current 0 Then
current = prev / current
Text1.Text = current
Else
Text1.Text = "Press AC to continue"
dz.Visible = True
dz.Caption = "Division by ZERO"
End If
If current < 0 Then
sroot.Enabled = False
Else
sroot.Enabled = True
End If

Exit Sub
MyErr:
MsgBox Err.Description, vbInformation, "信息提示"
End Sub



Private Sub expo_Click()
On Error GoTo MyErr

Exit Sub
MyErr:
MsgBox Err.Description, vbInformation, "信息提示"
End Sub

Private Sub expo10_Click()
Dim i As Integer
Dim j As Double
j = current
current = 1
For i = 1 To j Step 1
current = current * 10
Next i
Text1.Text = current

End Sub


Private Sub Form_Unload(Cancel As Integer)
Dim value As Integer

End Sub

Private Sub invcos_Click()
Dim temp As Double
temp = current * 3.14159265358979 / 180
If (temp = -1) Then
Text1.Text = 1 / Cos(temp)
current = 1 / Cos(temp)
End If
invsine.Visible = False
invcos.Visible = False
invtan.Visible = False
expo.Visible = False
expo10.Visible = False
End Sub

Private Sub invsine_Click()
Dim temp As Double
temp = current * 3.14159265358979 / 180
If (temp = -1) Then
Text1.Text = 1 / Sin(temp)
current = 1 / Sin(temp)
End If

End Sub

Private Sub invtan_Click()
Text1.Text = 1 / Tan(current * 3.14159265358979 / 180)
current = 1 / Tan(current * 3.14159265358979 / 180)
invsine.Visible = False
invcos.Visible = False
invtan.Visible = False
expo.Visible = False
expo10.Visible = False
End Sub

Private Sub logn_Click()
Text1.Text = Log(current)
current = Log(current)
End Sub

Private Sub logten_Click()
Text1.Text = Log(current) / Log(10)
current = Log(current) / Log(10)
End Sub

Private Sub mode_MouseDown(Button As Integer, shift As Integer, X As Single, Y As Single)
counter = counter + 1
If counter > 2 Then
counter = 1
End If
If counter = 2 Then
displaylb.Caption = "Normal Calculator"
displaylb.ForeColor = &HFFC0C0
Form1.Width = 4830
sine.Visible = False
cosine.Visible = False
tangent.Visible = False
logn.Visible = False
logten.Visible = False
random.Enabled = False
random.Visible = False
shiftb.Visible = False
recall.Visible = False
Else
displaylb.Caption = " Scientific Calculator"
displaylb.ForeColor = &HC0&
Form1.Width = 5670
sine.Visible = True
cosine.Visible = True
tangent.Visible = True
logn.Visible = True
logten.Visible = True
random.Enabled = True
random.Visible = True
shiftb.Visible = True
recall.Visible = True
End If
End Sub

Private Sub point_Click()
If Text1.Text = "" Then
Text1.Text = "0."
Else
Text1.Text = Text1.Text & "."
End If
End Sub

Private Sub random_Click()
Text1.Text = (2.1021020134 * Rnd + 1)
End Sub

Private Sub recall_Click()
Text1.Text = current
End Sub

Private Sub shiftb_Click()
invsine.Visible = True
invcos.Visible = True
invtan.Visible = True
expo.Visible = True
expo10.Visible = True
If Text1.Text = -1 Then
invsine.Enabled = True
invcos.Enabled = True
End If
invtan.Enabled = True
expo.Enabled = True
expo10.Enabled = True
End Sub

Private Sub sign_Click()
If current < 0 Then
Text1.Text = -current
current = -current
Else
Text1.Text = "-" & Text1.Text
current = -current
End If
If current < 0 Then
sroot.Enabled = False
Else
sroot.Enabled = True
End If
End Sub

Private Sub minus_Click()
Text1.Text = ""
choice = "-"
prev = current
current = 0
End Sub

Private Sub plus_Click()
Text1.Text = ""
choice = "+"
prev = current
current = 0
End Sub

Private Sub sine_Click()
Text1.Text = Sin(current * 3.14159265358979 / 180)
current = Sin(current * 3.14159265358979 / 180)
End Sub

Private Sub slash_Click()
Text1.Text = ""
choice = "/"
prev = current
current = 0
End Sub

Private Sub sroot_Click()
On Error GoTo MyErr
Text1.Text = Sqr(current)
current = Sqr(current)

Exit Sub
MyErr:
MsgBox Err.Description, vbInformation, "信息提示"
End Sub

Private Sub tangent_Click()
Text1.Text = Tan(current * 3.14159265358979 / 180)
current = Tan(current * 3.14159265358979 / 180)
End Sub

兄弟你可真行!!要代码也不给分,算了,我就做回好人吧!


VB求一个科学计算器源代码,谢谢啦

由于本人级别不够,不能上传照片
图片在你的QQ邮箱里
运行界面,编程界面我发到你的邮箱里

Option Explicit
Dim s_id As Integer
Dim s As String
Dim s1 As Double
Function p(x As Double) As Boolean
If InStr(x, ".") = 0 Then
p = False
Else
p = True
End If
End Function
Private Sub C_Click(Index As Integer)
Select Case s_id
Case 0, 2
Text1.Text = Text1.Text & Index
Case 1
Text1.Text = Index
s_id = 2
Case 3
Text1.Text = Index
s_id = 0

End Select
End Sub

Private Sub CmdAdd_Click()
Select Case s_id
Case 0
s = "+"
s1 = Text1.Text
s_id = 1
Case 2
CmdDY_Click
s = "+"
s1 = Text1.Text
s_id = 1
End Select
End Sub

Private Sub CmdBK_Click()
If Len(Text1.Text) > 0 Then
Text1.Text = Mid(Text1.Text, 1, Len(Text1.Text) - 1)
End If
End Sub

Private Sub CmdC_Click()
s_id = 0
Text1.Text = ""
End Sub

Private Sub CmdCF_Click()
s_id = 1
s = "*"
s1 = Text1.Text
End Sub

Private Sub CmdDY_Click()
If s_id = 2 Then
Select Case s
Case "+"
Text1.Text = s1 + Val(Text1.Text)
s_id = 3
Case "-"
Text1.Text = s1 - Val(Text1.Text)
s_id = 3
Case "*"
Text1.Text = s1 * Val(Text1.Text)
s_id = 3
Case "/"
Text1.Text = s1 / Val(Text1.Text)
s_id = 3

End Select
End If
End Sub

Private Sub CmdJF_Click()
Select Case s_id
Case 0
s = "-"
s1 = Text1.Text
s_id = 1
Case 2
CmdDY_Click
s = "-"
s1 = Text1.Text
s_id = 1
End Select
End Sub

Private Sub CmdP_Click()
If Not p(Text1.Text) Then
Text1.Text = Text1.Text & "."
End If
End Sub

Private Sub CmdSQRT_Click()
Text1.Text = Sqr(Val(Text1.Text))
End Sub

Private Sub CmdX1_Click()
Text1.Text = 1 / Val(Text1.Text)
End Sub

Private Sub CmdZF_Click()
Text1.Text = -Val(Text1.Text)
End Sub

Private Sub Command20_Click()
s_id = 1
s = "/"
s1 = Text1.Text
End Sub

Private Sub Form_Load()
Dim i As Integer
For i = 0 To 9
C(i).Caption = i
Next i
s_id = 0
End Sub


谁知道人品计算器工作原理?我不急,大家慢慢来。无厘头一点无所谓

你是指程序上么...个人认为这类输出类都会先将输入的内容转制为数值型字符 可能是用ASCII码或定义字符表 在其上对各个数值进行一些列简单运算将不同的输入内容导出不同的计算结果 再将计算结果的数值用case一类函数对应输出的图片或人品解析文字段在显示出来...
如果是输入生日,名字笔画或选项一类就更简单了了,电脑么 数值上的处理会更方便 所以才会叫计算机...不好玩


上一篇:思朗

下一篇:元斌