Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Arrays
- {
- class Program
- {
- static void Main(string[] args)
- {
- int countClothes = int.Parse(Console.ReadLine());
- int totalSum = 0;
- for (int clothes = 1; clothes <= countClothes; clothes++)
- {
- string type = Console.ReadLine();
- //проверка за типа на дрехата: t-shirt, jeans, trainers, jacket
- if(type == "t-shirt")
- {
- totalSum += 20;
- //totalSum = totalSum + 20;
- }
- else if(type == "jeans")
- {
- totalSum += 50;
- //totalSum = totalSum + 50;
- }
- else if (type == "trainers")
- {
- totalSum += 70;
- //totalSum = totalSum + 70;
- }
- else if (type == "jacket")
- {
- totalSum += 60;
- //totalSum = totalSum + 60;
- }
- }
- Console.WriteLine($"{totalSum:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment