Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class Kertoma { // MIHIN JA MITEN SE WHILE TULEE???
- public static void main(String[] args) {
- int n;
- int kertoma;
- int alku = 1;
- BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
- try {
- System.out.print("Anna kokonaisluku:");
- n = Integer.parseInt(in.readLine());
- kertoma = alku * alku++;
- System.out.println("Luvun " + n + " kertoma on " + kertoma);
- } catch(Exception e) {
- System.out.println("Virhe syötteessä.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement