import java.util.Scanner;
public class JPA308 {
static Scanner keyboard = new Scanner(System.in);
static int i = -1;
public static void main(String[] args) {
int total = 0, s = 0;
do{
s+=i;
System.out.print("請輸入消費金額,或輸入-1結束:");
i=keyboard.nextInt();
}while(i!=-1);
System.out.println("電腦周邊總消費 : "+(s+1));
}
}
沒有留言:
張貼留言