Advertisement
IvanGeorgiev

Untitled

Jul 18th, 2020
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace exam1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int days = int.Parse(Console.ReadLine());
  14. int hours = int.Parse(Console.ReadLine());
  15. double sum = 0;
  16. double sum1 = 0;
  17. int x = 0;
  18. int y = 0;
  19.  
  20.  
  21. for (int i = 1; i <= days; i++)
  22. {
  23. for (int j = 1; j <= hours; j++)
  24. {
  25. if (i % 2 == 0)
  26. {
  27. if (j % 2 != 0)
  28. {
  29. sum += 2.50;
  30. }
  31.  
  32. else
  33. {
  34. sum += 1;
  35. }
  36. x = i;
  37.  
  38. }
  39.  
  40.  
  41.  
  42. if (i % 2 != 0)
  43. {
  44. if (j % 2 == 0)
  45. {
  46. sum1 += 1.25;
  47. }
  48.  
  49. else
  50. {
  51. sum1 += 1;
  52. }
  53. y = i;
  54.  
  55. }
  56.  
  57.  
  58. }
  59. Console.WriteLine($"Day: {y} - {sum1:f2} leva");
  60.  
  61. Console.WriteLine($"Day: {x} - {sum:f2} leva");
  62.  
  63.  
  64. }
  65. Console.WriteLine($"Total: {sum + sum1:f2} leva");
  66.  
  67. }
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement