Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int number1,number2,ONEahadotfirst,ONEahadotsecond,ONEalafimfirst,ONEalafimsecond,TWOmeotfirst,TWOmeotsecond,TWOasarotfirst,TWOasarotsecond;
- System.out.println("הכנס מספר בעל 4 ספרות");
- number1=input.nextInt();
- System.out.println("הכנס מספר בעל 4 ספרות");
- number2=input.nextInt();
- ONEahadotfirst = number1%10;
- ONEahadotsecond = number2%10;
- ONEalafimfirst = number1/1000;
- ONEalafimsecond = number2/1000;
- TWOmeotfirst = number1%1000/100;
- TWOmeotsecond = number2%1000/100;
- TWOasarotfirst = number1/10%10;
- TWOasarotsecond = number2/10%10;
- System.out.println("המספר שבנוי מהספרות החיצוניות הוא"+ ONEahadotfirst + ONEahadotsecond+ ONEalafimfirst + ONEalafimsecond );
- System.out.println(" המספר שבנוי מספרות פנימיות הוא" +TWOmeotfirst+ TWOmeotsecond+ TWOasarotfirst+ TWOasarotsecond);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement