Advertisement
Vladimir76

задача 3

Dec 27th, 2013
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. Console.Write("enter a value a1:");
  2. int a1 = int.Parse(Console.ReadLine());
  3. if (a1 < 0)
  4. {
  5. a1 = a1 * (-1);
  6. int const1 = 100;
  7. int const2 = 10;
  8. double rezult1 = a1 / const1;
  9. double rezult2 = rezult1 % const2;
  10. Console.WriteLine(rezult2);
  11. if (rezult2 == 7)
  12. {
  13. Console.WriteLine("third digit is: 7");
  14. }
  15. else
  16. {
  17. if (rezult2 > 7)
  18. {
  19. Console.WriteLine("third digit is > 7");
  20. }
  21. else
  22. {
  23. Console.WriteLine("third digit is < 7");
  24. }
  25. }
  26.  
  27. }
  28. else
  29. {
  30. if (a1 >= 0)
  31. {
  32. a1 = a1 * 1;
  33. int const1 = 100;
  34. int const2 = 10;
  35. double rezult1 = a1 / const1;
  36. double rezult2 = rezult1 % const2;
  37. Console.WriteLine(rezult2);
  38. if (rezult2 == 7)
  39. {
  40. Console.WriteLine("third digit is: 7");
  41. }
  42. else
  43. {
  44. if (rezult2 > 7)
  45. {
  46. Console.WriteLine("third digit is > 7");
  47. }
  48. else
  49. {
  50. Console.WriteLine("third digit is < 7");
  51. }
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement