Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Shavit Borisov
- // CW
- import java.util.Scanner;
- public class TwentyNumbersV2 {
- public static void main(String[] args)
- {
- Scanner in = new Scanner (System.in);
- int num, sum;
- System.out.println("Enter 2 digit numbers:");
- for(;;)
- {
- num = in.nextInt();
- if(num==-1)
- break;
- sum = num%10 + num/10;
- System.out.printf("%d ", sum);
- }
- in.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement