Guest User

Untitled

a guest
Jun 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. public class LukusarjanSumma {
  5.  
  6. public static void main(String[] args) {
  7. Scanner lukija = new Scanner(System.in);
  8. System.out.println("Mihin asti? ");
  9. int luku = Integer.parseInt(lukija.nextLine());
  10.  
  11. int tulos = 0;
  12.  
  13. int i = 0;
  14. while (i <= luku) {
  15. tulos += 1;
  16. i++;
  17. }
  18. System.out.println("Summa on " + tulos);
  19. }
  20. }
Add Comment
Please, Sign In to add comment