猫史档案馆


Lonely_wanderer

Lonely_wanderer

Lv.1

我的昵称一直不敢改,怕你们回来后认不出我了

获赞:218收藏:57浏览:1300作品收藏:54
回复帖子评论
上一页3 页 / 共 26下一页

【机密地图】水世界主要人员重开新图 中回复

不想……

2020-03-09T15:24:09 点赞:0

【代码岛3.0】最新消息!我这边代码岛网址等不上去了 中回复

……看来我们都是一样的

2020-03-09T19:42:14 点赞:0

这是怎么回事? 中回复

11:00怎么了?我12:00还收到过官方的消息呢……

2020-03-10T09:09:25 点赞:0

【LW说】第三期:用C++模仿cmd,做一个命令提示符 中回复

额,因为帖子不给写c m d所以,就会变成c喵……

2020-03-10T15:30:23 点赞:0

钱能解决的问题,我都解决不了 中回复

……

2020-03-10T19:47:53 点赞:0

【Python作品分享】ZCH计算器【作品秀】 中回复

<html>
<head>
<script language="JavaScript">

r=new Array(2)

function setStartState(){
state="start"
r[0]="0"
r[1]="0"
operand=""
ix=0


}


function addDigit(n){


//alert(n)
if(state=="gettingInteger"||state=="gettingFloat")
r[ix]=appendDigit(r[ix],n)
else{
r[ix]=""+n
state="gettingInteger"


}


display(r[ix])
}



function appendDigit(n1,n2){

if(n1=="0")
  return ""+n2
var s=""
s+=n1
s+=n2
return s

}


function display(s){
document.calculator.total.value=s
}


function addDecimalPoint(){
if(state!="gettingFloat"){
decimal=true
r[ix]+="."
if(state=="haveOperand"||state=="getOperand2")
  r[ix]="0."
state="gettingFloat"
display(r[ix])
}
}


function clearDisplay(){
setStartState()
display(r[0])
}


function changeSign(){
if(r[ix].charAt(0)=="-") r[ix]=r[ix].substring(1,r[ix].length)
else if(parseFloat(r[ix])!=0) r[ix]="-"+r[ix]
display(r[ix])
}


function calc(){
if(state=="gettingInteger"||state=="gettingFloat"||state=="haveOperand"){
  if(ix==1){
   r[0]=calculateOperation(operand,r[0],r[1])
   ix=0
}
}

else if(state=="getOperand2"){
  r[0]=calculateOperation(operand,r[0],r[0])
  ix=0
}


state="haveOperand"
decimal=false
display(r[ix])
}


function calculateOperation(op,x,y){
var result=""
if(op=="+"){
  result=""+(parseFloat(x)+parseFloat(y))
}else if(op=="-"){
  result=""+(parseFloat(x)-parseFloat(y))
}else if(op=="*"){
  result=""+(parseFloat(x)*parseFloat(y))
}else if(op=="√"){
  result=""+Math.sqrt((parseFloat(x)))
}else if(op=="∧"){
  result=""+(Math.pow(parseFloat(x),parseFloat(y)))
}
else if(op=="/"){
  if(parseFloat(y)==0){
    alert("除数不能为零")
    result=0
}else
    result=""+(parseFloat(x)/parseFloat(y))
}
return result
}

function performOp(op){
  if(state=="start"){
  ++ix
  operand=op
}else if(state=="gettingInteger"||state=="gettingFloat"||state=="haveOperand"){
  if(ix==0){
  ++ix
  operand=op
}else{
  r[0]=calculateOperation(operand,r[0],r[1])
  display(r[0])
  operand=op
}
}

state="getOperand2"
decimal=false

}


</script>
</head>
<body>
<script>
  setStartState();
</script>


<form name="calculator">
<table border="BORDER" align="center">
<tr>
<td colspan=4 align="left"><input type="text" name="total" value=0 size=55></td>
</tr>
<tr>
<td><input type="button" name="n0" value="     0     " onclick="addDigit(0);"></td>
<td><input type="button" name="n1" value="     1     " onclick="addDigit(1);"></td>
<td><input type="button" name="n2" value="     2     " onclick="addDigit(2);"></td>
<td><input type="button" name="n3" value="     3     " onclick="addDigit(3);"></td>
</tr>
<tr>

<td><input type="button" name="n4" value="     4     " onclick="addDigit(4);"></td>
<td><input type="button" name="n5" value="     5     " onclick="addDigit(5);"></td>
<td><input type="button" name="n6" value="     6     " onclick="addDigit(6);"></td>
<td><input type="button" name="n7" value="     7     " onclick="addDigit(7);"></td>

</tr>
<tr>
<td><input type="button" name="n8" value="     8     " onclick="addDigit(8);"></td>
<td><input type="button" name="n9" value="     9     " onclick="addDigit(9);"></td>
<td><input type="button" name="decimal" value="     .     " onclick="addDecimalPoint();"></td>
<td><input type="button" name="plus" value="     +     " onclick="performOp('+');"></td>
</tr>

<tr>
<td><input type="button" name="minus" value="     -     " onclick="performOp('-');"</td>
<td><input type="button" name="multiply" value="     *     " onclick="performOp('*');"</td>
<td><input type="button" name="except" value="     /     " onclick="performOp('/');"</td>
<td><input type="button" name="equals" value="     =     " onclick="calc();"</td>
</tr>
<tr>

<td><input type="button" name="sign" value="    +/-    " onclick="changeSign('*');"</td>
<td><input type="button" name="clearField" value="     C     " onclick="clearDisplay();"</td>
<td><input type="button" name="sqrt" value="     √    " onclick="performOp('√');"</td>
<td><input type="button" name="pow" value="     ∧    " onclick="performOp('∧');"</td>
</tr>
</table>
</form>
</body>
</html>

2020-03-11T14:11:57 点赞:0

[干货+滑稽]如何在编辑器中整人-访客大爆炸 中回复

对的,阔以啊

2020-03-11T18:03:55 点赞:0

c++教程一本无需下载APP 中回复

????学C++还不需要下载????

2020-03-12T11:48:06 点赞:0

看网课回放的时候发现的鬼魂! 中回复

你确定不是卡了吗?

2020-03-12T11:59:45 点赞:1

叫你怎么制作VIP黑名单和普通玩家。 中回复

这个不是很简单吗?

2020-03-12T12:52:26 点赞:0

【Python作品分享】坑!爹!啊!【作品秀】 中回复

这个就是一个很简单而又贱的问答题~~~

2020-03-12T13:29:19 点赞:0

重新来!【故事接龙】断桥的无聊生活 中回复

写可以啊

2020-03-12T13:31:21 点赞:0

【道歉】关于昵称:代码终结者喜欢在断桥的帖子下BB 事件的整理与反思…… 中回复

咋还有双人格呢?我看看(其实,自己觉得自己也有……)

2020-03-12T20:12:51 点赞:0

【举报】YDS跃动工作室骂倚轩观澜 中回复

那个不是跃动工作室的!!!!!

那个人是假的!!!!

悦动没有这个人!!!!!

他就是冒牌的!!!!!

另外,他也冒牌了观澜的小号!!!!!!

观澜的小号和YDS跃动工作室都是那个**加假办的!!!!

2020-03-12T20:15:39 点赞:2

funny 快报 中回复

我的鬼畜新闻算吗???

2020-03-13T09:21:08 点赞:0

在线虚拟机来啦! 中回复

Linux根本打不开

2020-03-13T09:27:02 点赞:1

在线虚拟机来啦! 中回复

你这个卡到爆!!!!

2020-03-13T09:28:47 点赞:1

嗯嗯嗯什么鬼 中回复

卡了

2020-03-13T12:28:38 点赞:0

【召集代码】【代码岛3.0】 中回复

这个很简单,首先,让他变成实体动不了,在循环扣他的血

2020-03-13T12:34:03 点赞:0

【代码岛3.0】吉吉喵是啥职业? 中回复

抢沙发了……

2020-03-13T13:00:20 点赞:0

【求收藏求评】互相收藏吗? 中回复

又是一位退隐的大佬……

2020-03-16T08:52:55 点赞:0

教我的傻徒弟如何加QQ 中回复

woc,别跟我说,你的徒弟连qq都不会加???

2020-03-16T14:55:34 点赞:0

教我的傻徒弟如何加QQ 中回复

而且,不是每个人的qq版本都是这样的,像我们这些走在信息技术端的人,自己不认识的一个陌生软件,慢慢就会摸索会了

2020-03-16T14:56:44 点赞:0

呼····新做了一个代码岛2的地图 中回复

蓝雀,box3都出了,你为啥还用box2呢???

是编程的问题吗???

2020-03-16T14:57:39 点赞:0

诡异!BOX3.0内测版月球大战灵异事件 中回复

那就要看编辑器里边的了,可能更改过代码……

2020-03-16T15:02:53 点赞:0

【!】!!!! 中回复

ok,看到了!!!

2020-03-16T15:07:14 点赞:0

全新地图,奇妙游乐园上市了! 中回复

顶顶顶!!!

2020-03-16T16:44:06 点赞:0

代码岛发现不能访问现象 中回复

对啊,代码岛现在已经非常的混乱了!!!!

是不是就会出现进不去的状况,而且,有时候,连代码都运行不了!!!!

看来,box3是彻底的完了……

2020-03-18T09:44:33 点赞:0

这........怎么回事 中回复

不晓得,检查你自己的网络

2020-03-18T09:45:10 点赞:0

近日,代码岛3.0出现了一些很离谱的bug!!! 中回复

额,我的沙发……那就板凳吧

2020-03-18T10:24:06 点赞:0