herrDeng網內搜尋

自訂搜尋

Ads

2016年10月19日 星期三

ex10.鍊結串列練習

a[]={1,1,2,3,5,8,13,21,34};

建立鍊節串列,並列印之

64 則留言:

B10433037 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
}

}

B10433036 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
}

}

B10333022李昕翰 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
}
}
public class Ex10 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
//新增在開頭
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
}

}




hello

B10433044吳玉瀚 提到...

class Node{
int data;
Node next;
public Node(int data) {
this.data = data;
next=null;
}
}
public class a01 {
public static void main(String[] args) {
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0;i<f.length;i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node ctrl=first;
while (ctrl!=null) {
System.out.print(ctrl.data+"|");
ctrl=ctrl.next;
}
}
}

34|21|13|8|5|3|2|1|1|

B10433037 陳鈞傑 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}
hello
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433027 提到...

class Node

{

int data;

Node next;

public Node(int data)

{

this.data = data;

next=null;

}

}

public class ex01 {

public static void main(String[] args)

{

int f[]={1,1,2,3,5,8,13,21,34};

Node first=null;

Node newNode;

int i=0;

for(i=0;i
{

newNode=new Node(f[i]);

newNode.next=first;

first=newNode;

}

Node current=first;

while(current!=null)

{

System.out.print("|"+current.data+"|");

current=current.next;

}

System.out.println();

}

}

B10433014 楊偉杰 提到...

package ex1;
class Node{
int data;
Node next;
public Node(int data){
this.data=data;
next=null;
}
}
public class hw1 {

public static void main(String[] args) {
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0;i<f.length;i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

[34]
[21]
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433023李佳明 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class EX1
{
public static void main(String[] args)
{
System.out.println("[以下開始]");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
//新增在開頭
for(int i=0; i<f.length; i++)
{
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
//列印
Node current=first;
while (current!=null)
{
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();

}
}


[以下開始]
[34][21][13][8][5][3][2][1][1]

B10433022吳欣芸 提到...

class Nobe{
int data;
Nobe next;
public Nobe(int data){
this.data=data;
next=null;
}
}
public class P1 {



public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Nobe first=null;
Nobe newNobe;
for (int i=0;i<f.length;i++){
newNobe=new Nobe(f[i]);
newNobe.next=first;
first=newNobe;
}
Nobe current=first;
while (current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();

}

}


hello
[34]
[21]
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433037 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}


hello
[34]
[21]
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433036 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}


hello
[34][21][13][8][5][3][2][1][1]

B10433042 提到...

package ex1;
class Node{
int data;
Node next;
public Node(int data){
this.data=data;
next=null;
}
}
public class hw1 {

public static void main(String[] args) {
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0;i<f.length;i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}



[34]
[21]
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433025 提到...

package ex1;
class Node{
int data;
Node next;
public Node(int data){
this.data=data;
next=null;
}
}
public class hw1 {

public static void main(String[] args) {
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0;i<f.length;i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}



[34]
[21]
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10333022李昕翰 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
}
}
public class Ex10 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
//新增在開頭
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
//列印
Node current=first;
while (current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}





hello
[34]
[21]
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433026 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}


hello
[34]
[21]
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433053謝肇安 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class ex1 {

public static void main(String[] args)
{
System.out.println("Hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0 ; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

B10433038詹恭煒 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class ex1 {

public static void main(String[] args)
{
System.out.println("Hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0 ; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

B10433194謝旻君 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class ex1 {

public static void main(String[] args)
{
System.out.println("Hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0 ; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

B10433193林佩縈 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class ex1 {

public static void main(String[] args)
{
System.out.println("Hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0 ; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

B10433068丁麗馨 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data=data;
next=null;
}
}
public class ex1
{

public static void main(String[] args)
{
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;

for(int i=0; i<f.length; i++)
{
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null)
{
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

B10433185施慧齡 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class ex1 {

public static void main(String[] args)
{
System.out.println("Hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0 ; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

B10433049宋子文 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

b10233028 王曉琪 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data=data;
next=null;
}
}

public class ex01 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;


for (int i=0;i<f.length;i++){
newNode=new Node(f[2*i%7]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}


B10433008王靖雲 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class ex01
{
public static void main(String[] args)
{
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;

for(int i=0; i<f.length ; i++)
{
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null)
{
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

結果:hello
[8][5][3][2][1][1]

B10433001林威翰 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

B10433021呂志信 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

B10433031陳頌恩 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

B10433018張易儒 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

B10433007張聖鑫 提到...

class Node{
int data;
Node next;
public Node(int data) {
this.data = data;
next = null;
}
}

public class ex01 {

public static void main(String[] args) {
System.out.println("hello");

int f[] = {1,1,2,3,5,8,13,21,34};
Node first = null;
Node newNode;

for(int i=0; i<f.length; i++)
{
newNode = new Node(f[i]);
newNode.next = first;
first = newNode;
}
Node current=first;
while (current != null)
{
System.out.print("["+current.data+"]");
current = current.next;
}
System.out.println();
}
}


hello
[34][21][13][8][5][3][2][1][1]

B10433016李俊諺 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

b10433083林綾萱 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class ex01
{
public static void main(String[] args)
{
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;

for(int i=0; i<f.length ; i++)
{
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null)
{
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

結果:hello
[8][5][3][2][1][1]

B10433010吳奇峰 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

B10433020沈柏軍 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data=data;
next=null;
}
}
public class ex1 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}



hello
[13][8][5][3][2][1][1]

B10433006張正祺 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data=data;
next=null;
}
}
public class ex1 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}



hello
[13][8][5][3][2][1][1]

B10433005沈沛姍 提到...

class Node{
int date;
Node next;
public Node(int date) {
this.date = date;
next=null;
}
}
public class ex01 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.date+"]");
current=current.next;
}
System.out.println();
}
}

B10433189杜恩瑋 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

B10433054孫若庭 提到...

class Node{
int date;
Node next;
public Node(int date) {
this.date = date;
next=null;
}
}
public class ex01 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.date+"]");
current=current.next;
}
System.out.println();
}
}

B10433190張文翰 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

B10433009蔡佩樺 提到...

class Node{
int date;
Node next;
public Node(int date) {
this.date = date;
next=null;
}
}
public class ex01 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.date+"]");
current=current.next;
}
System.out.println();
}
}

B10433188姜佩萱 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

b10433030 楊家睿 提到...

class Node{
int data;
Node next;
public Node(int data) {
this.data = data;
next = null;
}
}

public class ex01 {

public static void main(String[] args) {
System.out.println("hello");

int f[] = {1,1,2,3,5,8,13,21,34};
Node first = null;
Node newNode;

for(int i=0; i<f.length; i++)
{
newNode = new Node(f[i]);
newNode.next = first;
first = newNode;
}
Node current=first;
while (current != null)
{
System.out.print("["+current.data+"]");
current = current.next;
}
System.out.println();
}
}


hello
[21]
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433050徐佳偉 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

b10433051莊孟軒 提到...

class Node{
int data;
Node next;
public Node(int data) {
this.data = data;
next = null;
}
}

public class ex01 {

public static void main(String[] args) {
System.out.println("hello");

int f[] = {1,1,2,3,5,8,13,21,34};
Node first = null;
Node newNode;

for(int i=0; i<f.length; i++)
{
newNode = new Node(f[i]);
newNode.next = first;
first = newNode;
}
Node current=first;
while (current != null)
{
System.out.print("["+current.data+"]");
current = current.next;
}
System.out.println();
}
}

hello
[34]
[21]
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433015 提到...

class Node{
int data;
Node next;
public Node(int data) {
this.data = data;
next=null;
}
}
public class ex10 {
public static void main(String[] args) {
int a[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<a.length; i++){
newNode=new Node(a[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

B10333010陳彥逸 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
}
}
public class Ex10 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
//新增在開頭
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
}

}




hello

B10433022吳欣芸 提到...

class Node{
int data;
Node next;
public Node(int data) {
this.data = data;
next = null;
}
}

public class h1 {

public static void main(String[] args) {
System.out.println("hello");

int f[] = {1,1,2,3,5,8,13,21,34};
Node first = null;
Node newNode;

for(int i=0; i<f.length; i++)
{
newNode = new Node(f[i]);
newNode.next = first;
first = newNode;
}
Node current=first;
while (current != null)
{
System.out.print("["+current.data+"]");
current = current.next;
}
System.out.println();
}
}

b10433024 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}
hello
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B104333050徐佳偉 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class EX1
{
public static void main(String[] args)
{
System.out.println("[以下開始]");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
//新增在開頭
for(int i=0; i<f.length; i++)
{
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
//列印
Node current=first;
while (current!=null)
{
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();

}
}

B10433039游叡恩 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class ex1 {

public static void main(String[] args)
{
System.out.println("Hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0 ; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

b10433030 楊家睿 提到...

class Node
{
int data;
Node next;
public Node(int data)
{
this.data = data;
next=null;
}
}
public class ex1 {

public static void main(String[] args)
{
System.out.println("Hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0 ; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}
}

B10433029 宋狄淯 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}
hello
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433019 李佳潔 提到...

class Node{
int date;
Node next;
public Node(int date) {
this.date = date;
next=null;
}
}
public class ex01 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.date+"]");
current=current.next;
}
System.out.println();
}
}

B10233177吳國豪 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}
hello
[13]
[8]
[5]
[3]
[2]
[1]
[1]

b10433066劉民崧 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

b10433066劉民崧 提到...

package p1;
class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class hw1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
for (int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}

B10233049 黃家崙 提到...

class Node{
int date;
Node next;
public Node(int date) {
this.date = date;
next=null;
}
}
public class ex01 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.date+"]");
current=current.next;
}
System.out.println();
}
}

B10433040 葉峻宇 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
}
}
public class Ex10 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8};
Node first=null;
Node newNode;
//新增在開頭
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
}

}

b10433024 陳錡諹 提到...

class Node{
int date;
Node next;
public Node(int date) {
this.date = date;
next=null;
}
}
public class ex01 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.date+"]");
current=current.next;
}
System.out.println();
}
}

B10433083林綾萱 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}
hello
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433066劉民崧 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}
hello
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10433035 劉軒宇 提到...

class Node{
int date;
Node next;
public Node(int date) {
this.date = date;
next=null;
}
}
public class ex01 {

public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13,21,34};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while (current!=null){
System.out.print("["+current.date+"]");
current=current.next;
}
System.out.println();
}
}

B10233077 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}
hello
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10233187 張郁柔 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}
hello
[13]
[8]
[5]
[3]
[2]
[1]
[1]

B10233136 巫駿驛 提到...

class Node{
int data;
Node next;
public Node(int data){
this.data = data;
next=null;
}
}
public class ex1 {
public static void main(String[] args) {
System.out.println("hello");
int f[]={1,1,2,3,5,8,13};
Node first=null;
Node newNode;
for(int i=0; i<f.length; i++){
newNode=new Node(f[i]);
newNode.next=first;
first=newNode;
}
Node current=first;
while(current!=null){
System.out.println("["+current.data+"]");
current=current.next;
}
System.out.println();
}

}
hello
[13]
[8]
[5]
[3]
[2]
[1]
[1]

Related Posts Plugin for WordPress, Blogger...

熱門文章