- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
有人要求我制作一个简单的排序算法,以将 6 个数字的随机序列按数字顺序排序。但是,有人要求我使用 Barebones 来完成这项工作,Barebones 是 Computer Science, an Overview
一书中提出的一种理论语言。
可以找到关于该语言的一些信息here .
澄清一下,我是一名实习教师,一直在分析“迷你编程语言”及其在教学环境中的用途。我向我的导师建议我看准系统(语言)并询问我应该编写什么样的示例程序。他提出了一种简单的排序算法。现在,自从查看该语言后,我无法理解如何在不使用数组和 if
语句的情况下做到这一点。
交换变量值的代码是
while a not 0 do;
incr Aux1;
decr a;
end;
while b not 0 do;
incr Aux2
decr b
end;
while Aux1 not 0 do;
incr a;
decr Aux1;
end;
while Aux2 not 0 do;
incr b;
decr Aux2;
end;
但是,该语言不提供 < 或 > 运算符。
我可以使用什么作为解决方法?
最佳答案
哦,来吧,开始思考问题吧!
什么是数组?变量列表。
所以 Barebones 没有 if 语句?它有 while 循环。
继续你的作业。
关于algorithm - 准系统排序算法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2653984/
我正在尝试创建(在Java中)一个包含指定数量的整数k(例如,50、500、1000等)的整数数组,该数组不使用库函数或集合,但包含随机数范围内(即从 1 到 k)的数字分类,具有指定的重复百分比。
例如: MY_MESSAGE = 'Dear %s, hello.' # ... name = "jj" print MY_MESSAGE % name python 是否具有完成类似我上面的代码的功
我有一个使用 NUnit 3.4.1、NSubstitute 1.10.0 和 NCrunch 2.23.0.2 的文本夹具 此夹具中在任何时间点都有 2 个失败测试。每次我更改某些内容时,哪个测试失
我是一名优秀的程序员,十分优秀!