Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Mlody {
- public static void main(String[] args) {
- int x = 0;
- Scanner sc = new Scanner(System.in);
- System.out.println("Podaj pierwszą wartość X: \n");
- x = sc.nextInt();
- int y = x;
- while(true) {
- System.out.println("Podaj liczbe o którą należy podnieść X: ");
- x += sc.nextInt();
- if(y==x) {
- System.out.println("X się nie zmienił");
- }else {
- System.out.println("Obecnie x wynosi:" + x);
- y=x;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement