Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. public class PositiivisenLuvunLisaaminen {
  5.  
  6. public static void main(String[] args) {
  7. Scanner lukija = new Scanner(System.in);
  8. int summa = Integer.parseInt(lukija.nextLine());
  9. int luettu = Integer.parseInt(lukija.nextLine());
  10.  
  11. if (luettu > 0) {
  12. summa = summa + luettu;
  13. }
  14. System.out.println("Summa: " + summa);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement