我有这个数组:
a = {{4,2,2,6}, {2,1,1,2}}
Run Code Online (Sandbox Code Playgroud)
如何从该数组中检索索引到C程序?
例如:
a[1] -- {4,2,2,6}
a[1][2] -- 2
Run Code Online (Sandbox Code Playgroud) 好吧,我正在尝试使用“更好”的方案解释器/编译器MIT-SCHEME来编译这个简单的方案代码:
代码.scm:
(declare (usual-integrations))
(define (s x) (* x x))
(display (s 2))
Run Code Online (Sandbox Code Playgroud)
我在做什么?我这样做:
DXHJ ~ mit-scheme
DXHJ ~ (cf "code.scm")
;Generating SCode for file: "s.scm" => "s.bin"... done
;Compiling file: "s.bin" => "s.com"... done
;Unspecified return value
Run Code Online (Sandbox Code Playgroud)
好吧,在那之后我不能运行任何东西。如何生成.out文件?
如果我们按如下方式使用它:
re.sub("a\(\s*\d*\s*,\s*\d*\s*\)", "100", "a(440, 330)"
Run Code Online (Sandbox Code Playgroud)
我们得到:
>> "100"
Run Code Online (Sandbox Code Playgroud)
现在,例如我们在a()里面a():
re.sub("a\(\s*\d*\s*,\s*\d*\s*\)", "100", "a(30, a(30,30))")
Run Code Online (Sandbox Code Playgroud)
我们得到:
>> 'a(30, 100)'
Run Code Online (Sandbox Code Playgroud)
但是我想要这样的东西:
1. a(30, a(30,30)) # replace the nested 'a'
2. a(30, 100) # now work with the remainder
3. '100' # final string
Run Code Online (Sandbox Code Playgroud)
对不起我的英语不好.