Topic: 关于正交拉丁方表编程的问题!

  Print this page

1.关于正交拉丁方表编程的问题! Copy to clipboard
Posted by: LouisXG
Posted on: 2007-04-01 20:35

12345
23451
34512
45123
51234

怎样编码实现啊?(3种方法)

2.Re:关于正交拉丁方表编程的问题! [Re: LouisXG] Copy to clipboard
Posted by: aaarong
Posted on: 2007-04-02 01:24

public class Test3
{  public static void main(String[] args)
  {  String mes="12345";
    System.out.println(mes);
    char ch;
    for(int i=0;i<mes.length()-1;i++)
    {  ch=mes.charAt(0);
      mes=mes.substring(1,mes.length());
      mes+=ch;
      System.out.println(mes);
    }
  }  
}

3.Re:关于正交拉丁方表编程的问题! [Re: LouisXG] Copy to clipboard
Posted by: xuxiaolei
Posted on: 2007-04-02 12:26

int[] array = {1, 2, 3, 4, 5};
   int temp;
  
   for(int i = 0; i < array.length; i++)
   {
     if(i != 0)
     {
       temp = array[0];
       for(int m = 1; m < array.length; m++)
       {
         array[m - 1] = array[m];
       }
       array[array.length - 1] = temp;
     }
    
     for(int j = 0; j < array.length; j++)
     {
       System.out.print(array[j]);
     }
     System.out.println();
   }


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923