2007-11-09 13:16:38娃娃♡°
notebook partI
import java.util.Scanner;
public class Addition
{
public static void main(String args[])
{
Scanner input = new Scanner( System.in );
int x;
int count = 1;
int sum = 0;
System.out.print(”輸入一個數字”);
x = input.nextInt();
while( count <=x )
{
sum = sum + count;
count = count +1;
}
System.out.println(”sbh = ”+sum);
}
}
public class Addition
{
public static void main(String args[])
{
Scanner input = new Scanner( System.in );
int x;
int count = 1;
int sum = 0;
System.out.print(”輸入一個數字”);
x = input.nextInt();
while( count <=x )
{
sum = sum + count;
count = count +1;
}
System.out.println(”sbh = ”+sum);
}
}
下一篇:notebook II
拉拉
2007-11-10 12:29:35
娃娃
你寫一個程式去運算一下
搞不好就會算出我是誰唷~~!!
娃娃~!!你程式碼沒有縮排唷!!
如果寫大一點的程式,程式碼一大串時~~
會很難偵錯唷~!
要養成好習慣~!!
知道什麼是縮排吧!!
一夏要我教你JAVA
反倒是你教我JAVA
你這個人還真幽默ㄋㄟ>ˇ< 2007-11-19 12:38:09