Guest User

Untitled

a guest
Jan 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. /**********************************************************************************/
  2. /* Problem: d392 "读取练习——强大的加法!" from liouzhou_101 */
  3. /* Language: JAVA (589 Bytes) */
  4. /* Result: AC(308ms, 12.1MB) judge by this@ZeroJudge */
  5. /* Author: ssc24 at 2011-09-24 15:01:45 */
  6. /**********************************************************************************/
  7.  
  8.  
  9. package javaapplication42;
  10. import java.util.*;
  11. import java.math.*;
  12.  
  13.  
  14.  
  15. public class JavaApplication42 {
  16.  
  17.  
  18. public static void main(String[] args) {
  19.  
  20. Scanner sc = new Scanner(System.in);
  21.  
  22. while (sc.hasNext()){
  23. String input = sc.nextLine();
  24. StringTokenizer st = new StringTokenizer(input);
  25. long sum=0;
  26. //long temp=0;
  27. while(st.hasMoreTokens()){
  28. //temp =
  29. sum += Long.parseLong(st.nextToken());
  30. }
  31. System.out.println(sum);
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. }//whlle*/
  39. }//main
  40. }//class
Add Comment
Please, Sign In to add comment