我试图在smalltalk中创建一个新的排序方法.有谁知道如何改变这个排序java代码吱吱声?
public static void SelectionSort ( int [ ] num )
{
int i, j, first, temp;
for ( i = num.length - 1; i > 0; i - - )
{
first = 0; //initialize to subscript of first element
for(j = 1; j <= i; j ++) //locate smallest element between positions 1 and i.
{
if( num[j] < num[first] )
first = j;
}
temp = num[first]; //swap smallest found with element in position i.
num[first] = …Run Code Online (Sandbox Code Playgroud) 我用 Graphics 对象绘制了一条线。我想根据鼠标拖动的程度将这条线旋转一定的角度。我可以获得旋转它所需的度数,但是我如何根据该角度旋转线呢?
谢谢你!