Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Test {
- public static void main(String args[])
- {
- int i=0;
- double sum=0;
- while(i!=1)
- {
- Scanner sc=new Scanner(System.in);
- System.out.print("Legen Sie eine ganze Zahl : ");
- String str=sc.nextLine();
- if(str.equals("Ende"))
- {
- i=1;
- }
- else
- {
- sum=sum+Double.parseDouble(str);
- }
- }
- System.out.println("Summe : " +sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement