Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more ➡
Download
Standard view
Full view
of .
×
0 of .
Results for:
No results containing your search query
P. 1
95 學年 上學期 金門技術學院 資管系 夜二技 一年級

# 95 學年 上學期 金門技術學院 資管系 夜二技 一年級

Ratings: 0|Views: 542|Likes:
Published by 陳鍾誠

### More info:

Published by: 陳鍾誠 on Jan 18, 2010
Copyright:Attribution Non-commercial

### Availability:

Read on Scribd mobile: iPhone, iPad and Android.
Free download as PDF, DOC, TXT or read online for free from Scribd
See More
See less

01/17/2010

pdf

text

original

95

:

:

:
:
1

(20%)(a).

(10%)class Test1 {public static void main(String args[]) {int a[]={ 2, 1, 3};System.out.println("a[0]="+a[0]);intAdd(a[0]);System.out.println("a[0]="+a[0]);arrayAdd(a, 0);System.out.println("a[0]="+a[0]);arrayAdd(a, 1);System.out.println("a[1]="+a[1]);intAdd(a[1]);System.out.println("a[1]="+a[1]);}public static void intAdd(int x) {x++;}public static void arrayAdd(int y[], int i) {y[i]++;}}

a[0]=2a[0]=2a[0]=3a[0]=2a[0]=2(b).

(10%)class Test2 {public static void main(String args[]) {int y = f(3);System.out.println("y="+y);y = f(y);System.out.println("y="+y);f(y);System.out.println("y="+y);y=f(y);System.out.println("y="+y);y=f(5);System.out.println("y="+y);} public static int f(int x) {return x*3;}}

y=9y=27y=27y=81y=15
2

(20%)
(a)

100

(

)char a[]=new char[100];(b)

1000

(

)String a[]=new String[1000];(c)

days

(

) (

)int days[] ={31,28,31,30,31,30,31,31,30,31,30,31};(d)

5 0 0 (

)
0 3 00 0 1int a[][] = {{5,0,0},{0,3,0},{0,0,1}};
1

## Activity (1)

### Showing

AllMost RecentReviewsAll NotesLikes
You've already reviewed this. Edit your review.
1 hundred reads|over 3 years ago