Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class LukusarjanSumma {
- public static void main(String[] args) {
- Scanner lukija = new Scanner(System.in);
- System.out.println("Mihin asti? ");
- int luku = Integer.parseInt(lukija.nextLine());
- int tulos = 0;
- int i = 0;
- while (i <= luku) {
- tulos += 1;
- i++;
- }
- System.out.println("Summa on " + tulos);
- }
- }
Add Comment
Please, Sign In to add comment