1.А) 3418 = 3∙82+4∙81+1∙80 = 192+32+1 = 22510
Б) 3416 = 3∙62+4∙61+1∙60 = 108+24+1 = 13310
В) 34116 = 3∙162+4∙161+1∙160 = 768+64+1 = 83310
Г) 34.15 = 3∙51+4∙50+1∙5-1 = 15+4+0.2 = 19.210
Д) E41A.1216 = 14∙163+4∙162+1∙161+10∙160+1∙16-1+2∙16-2 = 57344+1024+16+10+0.0625+0.0078125 = 58394.070312510
2.)A) 356-356=0/2 178-178=0/2 289-88=1/2 44-44=0/2 22-22=0/2 11-10=1/2 5-4=1/2 2-2=0/2 1-0=1=>35610=1011001002.
356-352=4/8 44-40=4/8 40/8=5 => 35610=5448
356-352=4/16 22-16=6/16 16=1; => 35610=16416
Б)514-514=0/2 257-256=1/2 128-128=0/2 64-64=0/2 32-32=0/2 16-16=0/2 8-8=0/2 4-4=0/2 2-2=0/2 1=1 => 51410=10000000102
514-512=2/8 64-64=0/8; 8-8=0/8; 1=1 =>51410=10028
514-512=2/16 32-32=0/16 2=2 => 51410=20216
В)2018-2018=0/2 1009-1008=1/2 504-504=0/2 252-252=0/2 126-126=0/2 63-62=1/2 31-30=1/2 15-14=1/2 7-6=1/2 3-2=1/2 1=1 => 201810 = 111111000102
2018-2016=2/8 252-248=4/8 31-24=7/8 3=3 201810=>37428
2018-2016=2/16 126-112=14=E/16=7 => 201810 =7E216
Г)7654-7654=0/2 3827-3826=1/2 1913-1912=1/2 956-956=0/2 478-478=0/2 239-238=1/2 119-118=1/2 59-58=1/2 29-28=1/2 14-14=0/2 7-6=1/2 3-2=1/2=1 =>765410=11101111001102
7654-7648=6/8 956-952=4/8 119-112=7/8 14-8=6/8=1=>765410=167468
7654-7648=6/16 478-464=14=E/16 29-16=15=D/16=1 => 765410=1DE616
Д)78-78=0/2 39-38=1/2 19-18=1/2 9-8=1/2 4-4=0/2 2-2=0/2=1=>10011102=7810
78-72=6/8 9-8=1/8=1=>7810=1168
78-64=14=E/16=4 =>7810=4E16
Я просто сам сейчас это решаю)
Как создать свой Layout с элементами (LinearLayout,Spinner,View и т.п.) внутри так, чтобы управлять их расположением и анимацией?
main_activity.xml:
<LinearLayout
android:id = "@+id/window_1"
android:layout_width="200dp"
android:layout_height="100dp"
android:orientation="vertical">
<Spinner
android:id="@+id/WindowSpinner_1"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
<FrameLayout
android:id="@+id/container_1"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
<LinearLayout
android:id = "@+id/window_2"
android:layout_width="200dp"
android:layout_height="100dp"
android:orientation="vertical">
<Spinner
android:id="@+id/WindowSpinner_2"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
<FrameLayout
android:id="@+id/container_2"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
<LinearLayout
android:id = "@+id/window_3"
android:layout_width="200dp"
android:layout_height="100dp"
android:orientation="vertical">
<Spinner
android:id="@+id/WindowSpinner_3"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
<FrameLayout
android:id="@+id/container_3"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
<LinearLayout
android:id = "@+id/window_4"
android:layout_width="200dp"
android:layout_height="100dp"
android:orientation="vertical">
<Spinner
android:id="@+id/WindowSpinner_4"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
<FrameLayout
android:id="@+id/container_4"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
</com.android.prog.CustomLayout>
класс CustomLayout.java:
public class CustomLayout extends LinearLayout {
public CustomLayout(Context context) {
super(context);
}
public CustomLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public CustomLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public CustomLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public void doSomefing{//Задаём действия с элементами внутри CustomLayout
}
}
Объяснение: