1 | import java.util.Scanner; |
1 | import java.util.Scanner; |
1 | import java.util.Scanner; |
1 | import java.util.Scanner; |
Nothing… The problem is pretty easy, however it troubled me for a quite long time. Just follow the instruction of the problem and simulate the whole process by coding.
String
and int
carry
sign
char
to simplify the process1 | // the data type must be a type of class |
由于电机的端口是一个motor
类型的变量,所以我们可以将电机当作变量传参。
1 | void m(motor motorname,int speed=100,int tor=100) //定义一个名为m的函数,三个参数分别是电机端口、速度(默认100)、力矩(默认100)。 |
1 | // 底盘四个电机全功率向前1000ms |