risc-v中文社区

 找回密码
 立即注册
查看: 1819|回复: 2

一个不错的在线编程网站

  [复制链接]

347

主题

564

帖子

2237

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2237
发表于 2022-6-16 17:12:48 | 显示全部楼层 |阅读模式
很多编程语言都可以在这个网站上在线练习:https://jsrun.net/
回复

使用道具 举报

347

主题

564

帖子

2237

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2237
 楼主| 发表于 2022-6-17 10:56:51 | 显示全部楼层
c = 13.2
b = 4
print("c / b = ",c / b, " c % b= ",c % b)
print(type("Hello world"))      --> string
print(type(10.4*3))             --> number
print(type(print))              --> function
print(type(type))               --> function
print(type(true))               --> boolean
print(type(nil))                --> nil
print(type(type(X)))            --> string

function myfun(arg)
  if(arg == 0) then
     return 1
  else
     return arg * myfun(arg-1)
  end
end
print("myfun(5)=",myfun(5))



回复

使用道具 举报

347

主题

564

帖子

2237

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2237
 楼主| 发表于 2022-6-17 10:57:43 | 显示全部楼层
显示如下:
c / b =         3.3         c % b=         1.2
string
number
function
function
boolean
nil
string
myfun(5)=        120

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



Archiver|手机版|小黑屋|risc-v中文社区

GMT+8, 2024-4-26 06:34 , Processed in 0.017779 second(s), 17 queries .

risc-v中文社区论坛 官方网站

Copyright © 2018-2021, risc-v open source

快速回复 返回顶部 返回列表