![]() 擬似コード |
ようやく progJ.pdf 「1.簡単な例」の初稿ができました.
補足:(1) P11.java
public class P11{
public static void main(String[ ] args){
int i=2, k=3;
System.out.println("i+k="+(i+k));
//
int[] m1, n1={0,1,2}; int[][] m2, n2={new int[2], new int[3]};
m1 = new int[3]; n2[1][2] = 4;
m2 = new int[2][]; m2[1] = new int[3];
String s = "abc"; System.out.println(n2[1][2]+","+s);
}
}
(2) P15.java
public class P15{
static void add(int[] p, int k){p[0] += k;}
public static void main(String[ ] args){
int[] n={2,3};
add(n, 4); System.out.println(n[0]);
}
}
(3) P17.java
import java.io.*;
public class P17{
public static void main(String[ ] args) throws IOException{
BufferedReader r; String s; StringBuffer b = null;
try{
r = new BufferedReader(new InputStreamReader(System.in));
s = r.readLine(); b = new StringBuffer(s);
}catch(IOException e){System.out.println(e);}
System.out.println("b="+b);
}
}