Advertisement
Guest User

Untitled

a guest
Apr 14th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 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.  
  8. class Task2
  9. {
  10.     static void Main()
  11.     {
  12.         int n = int.Parse(Console.ReadLine());
  13.         int allLenght=0;
  14.         int countCables = 0;
  15.         int leftCM = 0;
  16.  
  17.         for (int i = 0; i < n; i++)
  18.         {
  19.             int currentlenght = int.Parse(Console.ReadLine());
  20.             string currentmeasure = Console.ReadLine();
  21.             if (currentlenght<20&&currentmeasure=="centimeters")
  22.             {
  23.                
  24.             }
  25.             else
  26.             {
  27.                 if (currentmeasure=="meters")
  28.                 {
  29.                     allLenght += (currentlenght * 100) - 3;
  30.                 }
  31.                 else
  32.                 {
  33.                     allLenght += currentlenght - 3;
  34.                 }
  35.                
  36.             }
  37.         }
  38.         countCables = (allLenght+3) / 504;
  39.         leftCM = (allLenght+3) % 504;
  40.         Console.WriteLine(countCables);
  41.         Console.WriteLine(leftCM);
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement