Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class PositiivisenLuvunLisaaminen {
- public static void main(String[] args) {
- Scanner lukija = new Scanner(System.in);
- int summa = Integer.parseInt(lukija.nextLine());
- int luettu = Integer.parseInt(lukija.nextLine());
- if (luettu > 0) {
- summa = summa + luettu;
- }
- System.out.println("Summa: " + summa);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement