Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Kertaa {
  3. public static void main(String [] args) {
  4. Scanner syote = new Scanner(System.in);
  5.  
  6. int summa = 0;
  7.  
  8. //EI TOIMI EI TOIMI EI TOIMI
  9.  
  10. System.out.print("Anna luku: ");
  11. int kerrottava = syote.nextInt();
  12.  
  13. System.out.print("Anna kertoja: ");
  14. int kertoja = syote.nextInt();
  15.  
  16. do {
  17. summa += kerrottava;
  18. kertoja--;
  19. } while (kertoja > 0);
  20.  
  21. System.out.println(summa);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement