純手打,很辛苦的,望采納,^_^
創(chuàng)新互聯(lián)是專業(yè)的京口網(wǎng)站建設公司,京口接單;提供成都做網(wǎng)站、成都網(wǎng)站制作,網(wǎng)頁設計,網(wǎng)站設計,建網(wǎng)站,PHP網(wǎng)站建設等專業(yè)做網(wǎng)站服務;采用PHP框架,可快速的進行京口網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團隊,希望更多企業(yè)前來合作!
完事,睡覺,有問題追問吧
1. 新建第1個頁面:
html
head
title實驗六:?表單/title
/head
body
form?name="form1"?action="B.html"
divh4實驗六:?表單/h4/div
div?style="font-size:12px;"
div?style="font-weight:bold;margin-bottom:20px;"請輸入您的基本信息(必須填寫)/div
div?style="height:25px;"span?style="margin-right:15px;"您的姓名:/spaninput?type="text"?name="userName"?style="width:250px;height:20px;"?//div
div?style="height:25px;"span?style="margin-right:15px;"您的性別:/spaninput?type="radio"?name="sex"?value="1"?checked="checked"?/男性?input?type="radio"?name="sex"?value="2"?/女性/div
div?style="height:25px;"span?style="margin-right:15px;"您的年齡:/spaninput?type="text"?name="bir"?style="width:250px;height:20px;"?//div
div?style="height:25px;"span?style="margin-right:15px;"所在單位:/spaninput?type="text"?name="unit"?style="width:250px;height:20px;"?//div
div?style="height:25px;"span?style="margin-right:15px;"電話號碼:/spaninput?type="text"?name="tele"?style="width:250px;height:20px;"?//div
div?style="font-weight:bold;margin:20px?0px;"請輸入您的其他信息(選擇填寫)/div
div?style="height:25px;"span?style="margin-right:15px;"您向往的職業(yè):/spanselect?name="work"option?value="1"教師/optionoption?value="2"醫(yī)生/optionoption?value="3"程序猿/option/select/div
div?style="height:25px;"span?style="margin-right:15px;"您喜歡的運動/spaninput?type="checkbox"?name="sp1"?value="1"?/足球?input?type="checkbox"?name="sp2"?value="2"?/籃球?input?type="checkbox"?name="sp3"?value="3"?/排球?input?type="checkbox"?name="sp4"?value="4"?/羽毛球?input?type="checkbox"?name="sp5"?value="5"?/乒乓球/div
div?style="height:110px;"span?style="margin-right:15px;"請給我留言:/spantextarea?name="re"?style="width:240px;height:100px;"/textarea/div
div?style="height:25px;"span?style="margin-right:15px;"單擊該按鈕顯示提交的個人信息:/spanbutton?name="cmd"確定/button/div
/div
/form
/body
/html
2. 新建第2個頁面:
html
head
title實驗六:?表單/title
script
window.onload?=?function(){
document.getElementById("userName").innerText?=?getQuery("userName");
var?sex?=?"";
if(getQuery("sex")?==?"1")
sex?=?"男";
else?if(getQuery("sex")?==?"2")
sex?=?"女";
document.getElementById("sex").innerText?=?sex;
document.getElementById("bir").innerText?=?getQuery("bir");
document.getElementById("unit").innerText?=?getQuery("unit");
document.getElementById("tele").innerText?=?getQuery("tele");
var?sex?=?"";
if(getQuery("work")?==?"1")
sex?=?"教師";
else?if(getQuery("work")?==?"2")
sex?=?"醫(yī)生";
else?if(getQuery("work")?==?"3")
sex?=?"程序猿";
var?sp?=?"";
if(getQuery("sp1")?==?"1")
sp?+=?"足球,";
if(getQuery("sp2")?==?"2")
sp?+=?"籃球,";
if(getQuery("sp3")?==?"3")
sp?+=?"排球,";
if(getQuery("sp4")?==?"4")
sp?+=?"羽毛球,";
if(getQuery("sp5")?==?"5")
sp?+=?"乒乓球,";
if(sp.length??0)
sp?=?sp.substring(0,?sp.length?-?1);
document.getElementById("sp").innerText?=?sp;
document.getElementById("re").innerText?=?getQuery("re");
};
function?getQuery(name)?{
var?reg?=?new?RegExp("(^|)"?+?name?+?"=([^]*)(|$)",?"i");
var?r?=?window.location.search.substr(1).match(reg);
if?(r?!=?null)?return?unescape(r[2]);?return?null;
}
/script
/head
body
divh4實驗六:?表單/h4/div
div?style="font-size:12px;"
div?style="font-weight:bold;margin-bottom:20px;"請輸入您的基本信息(必須填寫)/div
div?style="height:25px;"span?style="margin-right:15px;"您的姓名:/spanspan?id="userName"/span/div
div?style="height:25px;"span?style="margin-right:15px;"您的性別:/spanspan?id="sex"/span/div
div?style="height:25px;"span?style="margin-right:15px;"您的年齡:/spanspan?id="bir"/span/div
div?style="height:25px;"span?style="margin-right:15px;"所在單位:/spanspan?id="unit"/span/div
div?style="height:25px;"span?style="margin-right:15px;"電話號碼:/spanspan?id="tele"/span/div
div?style="font-weight:bold;margin:20px?0px;"請輸入您的其他信息(選擇填寫)/div
div?style="height:25px;"span?style="margin-right:15px;"您向往的職業(yè):/spanspan?id="work"/span/div
div?style="height:25px;"span?style="margin-right:15px;"您喜歡的運動/spanspan?id="sp"/span/div
div?style="height:110px;"span?style="margin-right:15px;"請給我留言:/spanp?id="re"/p/div
/div
/body
/html
public class Josephus{
public static void main(String[] args) {
mAndN(7,10);
}
public static void mAndN(int m, int n) {
CircleList cl = new CircleList(n);
cl.showSequence(m);
}
}
class CircleList{
Node head;
CircleList(int n){
head = new Node(1);
Node tail = head;
Node temp;
for(int i = 2;i = n;i++){
temp = new Node(i);
tail.setNext(temp);
tail = temp;
}
tail.setNext(head);
}
public void showSequence(int m) {
Node temp = head;
System.out.println("The sequence of getting out:");
while(head != head.getNext()){
for(int i = 0;i m;i++)
temp = temp.getNext();
System.out.print(temp.getNumber() + " ");
remove(temp);
head = temp;
}
System.out.println(head.getNumber());
}
public void remove(Node n){
n.setNumber(n.getNext().getNumber());
n.setNext(n.getNext().getNext());
}
}
class Node{
private int i;
private Node next;
Node(int i){
this.i = i;
}
public void setNumber(int i){
this.i = i;
}
public void setNext(Node next){
this.next = next;
}
public int getNumber(){
return i;
}
public Node getNext(){
return next;
}
}
輸出:
The sequence of getting out:
8 6 5 7 10 3 2 9 4 1
應該滿足你的要求了.myEclipse 9.0環(huán)境測試成功.如果可以用,請給分咯~
夠簡單了吧,實體類都沒用.
public static void main(String[] args) {
String[] sports = { "籃球", "足球", "排球", "羽毛球", "兵乓球", "網(wǎng)球" };
Scanner s = new Scanner(System.in);
String answer = "y";
while (answer.equals("y")) {
String[] chosed = randomS(sports);
System.out.println("指派某個學生的測試項目為:" + chosed[0] +"和" + chosed[1]);
System.out.println("要繼續(xù)嗎?(y/n)");
answer = s.nextLine();
}
}
private static String[] randomS(String[] sports) {
String[] chosed = new String[2];
int i = -1;
i = (int) (Math.random() * 6);
chosed[0] = sports[i];
while (true) {
i = (int) (Math.random() * 6);
if (sports[i].equals(chosed[0])) {
continue;
} else {
chosed[1] = sports[i];
break;
}
}
return chosed;
}