艺术家的感觉

JAVA第三次作业

package javazuoye;

import java.util.Scanner;

//import org.omg.Messaging.SyncScopeHelper;

public class lianjia {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
	
		text ae = new text();
		ae.method();
	}

}
class text{
	public void text(){
		
	}
	int sum = 0;
	 void method(){
		Scanner kbInput = new Scanner(System.in);
		kbInput.useDelimiter("\\s");
		while(kbInput.hasNextInt()){
			int nextValue = kbInput.nextInt();
			sum += nextValue;
		}
		kbInput.close();
		System.out.printf("sum:%d",sum);
	}
}

  

posted on 2016-03-28 18:55  艺术家的感觉  阅读(139)  评论(0编辑  收藏  举报

导航