Topic: 流的问题,希望斑竹和大家帮忙

  Print this page

1.流的问题,希望斑竹和大家帮忙 Copy to clipboard
Posted by: HJILY44
Posted on: 2004-12-02 13:36

import java.io.*;
public class c
{
public static void main(String[] args)
{int i=0;
byte[] s=new byte[10];
try
{
DataInputStream wc=new DataInputStream(System.in);
System.out.println("please input and enter when finished");
wc.read(s);
System.out.println();
System.out.println("begin to print input");
while(s[i]!=0)//如果我改成s[i]==0或是>=或<=后,不管我开始输入的第一数是0还是非0循环都不会执行?WHY?
{
System.out.print((char)s[i]);
i++;
}
System.out.println("TOTAL="+i);
wc.close();
}
catch(Exception a)
{
a.printStackTrace();
System.out.println("***********");
}
}
}

2.Re:流的问题,希望斑竹和大家帮忙 [Re: HJILY44] Copy to clipboard
Posted by: HJILY44
Posted on: 2004-12-02 13:37

是wc.read(s);
怎么显示成月亮了?

3.Re:流的问题,希望斑竹和大家帮忙 [Re: HJILY44] Copy to clipboard
Posted by: HJILY44
Posted on: 2004-12-02 13:38

我昏
WC。READ( S );

4.Re:流的问题,希望斑竹和大家帮忙 [Re: HJILY44] Copy to clipboard
Posted by: floater
Posted on: 2004-12-02 23:02

我昏 too.

check 禁止在这个帖子中使用笑脸标记 in 选项 right below 回复


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923