.


:




:

































 

 

 

 


1




1)

: X = 3.08763

:

3

0.08763

x=30.8763

2)

: X = 1.2345

:

1

0.2345

, 10

2.345

x=1


- 1

2.4 ++ 1

#include <iostream.h>

using namespace std;

int main()

{

float x;

cout<<"\nVvod x";

cin>>x;

float y,z;

//

y=(int)x;

//

z=x-(int)x;

cout<<"\nCelaya chast="<<y;

cout<<"\nDrobnaya chast="<<z;

//

if (y>z*10)

{

cout<<"\nCelaya chast bolshe";

x=x*10;

}

else

{

cout<<"\nDrobnaya chast *10 bolshe";

x=x-z;

}

cout<<"\nx="<<x;

}

 

2

, . , . , . , .

2

1)

: X = 4124

:

X = 2122

2)

: X = 2658

:

X = 2568

3)

: X = 8562

:

X = 2568

4)

: X = 5125

:

,

X = 5125

- 2

 

2.8 ++ 2

#include <iostream.h>

using namespace std;

int main()

{

int x,y,x1,x2,x3,x4;

cout<<"\Vvod x";

cin>>x;

// , Y

y=x;

x1=y / 1000; //

y= y % 1000; //

x2=y / 100; //

y= y % 100; //

x3=y / 10; //

x4= y % 10; //

//

//

y= 1000*x1 + 100*x2 + 10*x3 + x4;

cout<<"\nBilo x="<<x<<"\tStalo y="<<y;

cout<<"\nCifri:"<<x1<<"\t"<<x2<<"\t"<<x3<<"\t"<<x4;

if (x1==x4)

{

if (x1 % 2==0) // x4 , .. x1=x4

{

cout<<"\n Cifri ravni";

x1=x1 / 2;

x4=x4 / 2;

}

else

cout<<"\n Cifri ravni no necetni";

}

else

{

cout<<"\n Cifri ne ravni";

if (x1>x4)

{

y=x1;

x1=x4;

x4=y;

}

else

{

y=x2;

x2=x3;

x3=y;

}

}

x= 1000*x1 + 100*x2 + 10*x3 + x4;

cout<<"\n Posle preobrazovaniy x="<<x;

}

 

2.9

1. .

2. - .

3. , .

4. : , , , .

5. .

2.10

2

1. , , , .

2. . , .

3. . , .

4. . , .

5. , , , - .

6. , . , . ( - ).

7. , 10, .

8. . , .

9. 5 . , , .

10. , - . , .

11. . , , , .

12. . , , , .

13. . , , .

14. 10 . , .

15. . , , .

16. , , 5.

17. , , , . 100, , - , 100.

18. , 7. , , .

19. . , , .

20. , , - . , . , .

21. 8 . , .

22. , , 6.

23. , . Z+ X3, Z2-Y .

24. , , , p. p 175, , z - , 175.

25. 9 , . , .

26. . 11 11. , 5.

27. . . . , .

28. 3 , . , .

29. . 7 14. , 3.

30. b/ c . , , b .

 

3





:


: 2018-10-14; !; : 623 |


:

:

.
==> ...

1549 - | 1384 -


© 2015-2024 lektsii.org - -

: 0.033 .