home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 September
/
Chip_2004-09_cd1.bin
/
program
/
java
/
7
/
download
/
Cteni1.java
< prev
next >
Wrap
Text File
|
2004-05-16
|
590b
|
34 lines
import java.io.*;
public class Cteni1 {
public static void main(String[] args) throws Exception {
char znak;
StringBuffer sb = new StringBuffer(20);
InputStreamReader isr = new InputStreamReader(System.in);
System.out.println("Start programu (pro konec zadejte 'q')");
do {
znak = (char) isr.read();
if (znak == '\n') {
System.out.println("Zadali jste: " + sb);
sb.delete(0, sb.length());
} else {
sb.append(znak);
}
} while (znak != 'q');
System.out.println("Konec programu");
}
}