Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class K16Nr1IntegerAdiren {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner scan = new Scanner (System.in);
- int ergebnis =0,plus,anzahl , i=1;
- System.out.println("Wie oft addiren?");
- anzahl=scan.nextInt();
- while (i <= anzahl ){
- System.out.println("Bitte die " + i +". Zahl die addirt werden soll eingeben :");
- plus=scan.nextInt();
- ergebnis = plus + ergebnis ;
- i++;
- }
- System.out.println("Das ergebnis ist : " + ergebnis);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement