Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- class Task2
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int allLenght=0;
- int countCables = 0;
- int leftCM = 0;
- for (int i = 0; i < n; i++)
- {
- int currentlenght = int.Parse(Console.ReadLine());
- string currentmeasure = Console.ReadLine();
- if (currentlenght<20&¤tmeasure=="centimeters")
- {
- }
- else
- {
- if (currentmeasure=="meters")
- {
- allLenght += (currentlenght * 100) - 3;
- }
- else
- {
- allLenght += currentlenght - 3;
- }
- }
- }
- countCables = (allLenght+3) / 504;
- leftCM = (allLenght+3) % 504;
- Console.WriteLine(countCables);
- Console.WriteLine(leftCM);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement