Loading...

Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

Elena123456 avatar Elena123456 235 Точки

02. Easter Gifts- Technology Fundamentals Retake Mid Exam - 16 April 2019 (maybe Judge problem)

Please, can somebody try to submit for this exercise https://judge.softuni.bg/Contests/Practice/Index/1610#1 ? I think maybe their is a problem in Judge System, because I can't to submit my solution. Only showed this message "The contest cannot be practiced!". On my computer there is no problem, everything is ok.

You can check with my code:

using System;
using System.Collections.Generic;
using System.Linq;

namespace midExamFinal
{
    class MainClass
    {
        public static void Main(string[] args)
        {


            List<string> listOfGifts = Console.ReadLine().Split().ToList();

            string command = string.Empty;

            while ((command = Console.ReadLine()) != "No Money")
            {
                string[] commandArray = command.Split();

                if (commandArray[0] == "OutOfStock")
                {
                    string gift = commandArray[1];
                    while (listOfGifts.Exists(x => x == gift))
                    {
                        int indexOfGift = listOfGifts.IndexOf(gift);
                        listOfGifts[indexOfGift] = "None";
                    }
                }

                else if (commandArray[0] == "Required")
                {
                    string gift = commandArray[1];
                    int index = int.Parse(commandArray[2]);
                    if (index >= 0 && index <= listOfGifts.Count - 1)
                    {
                        listOfGifts[index] = gift;
                    }
                }

                else if (commandArray[0] == "JustInCase")
                {
                    string gift = commandArray[1];
                    listOfGifts[listOfGifts.Count - 1] = gift;
                }

            }

            var result = listOfGifts.Where(x => x != "None");
            Console.WriteLine(string.Join(" ",result));
        }

       }

    }

 

Тагове:
0
C# Fundamentals 17/10/2020 00:42:11
williamjone avatar williamjone 4 Точки

In today's dynamic business environment, staying ahead requires not only experience but also a solid foundation in professional knowledge. The AMA PCM exact questions answer stands as a testament to one's proficiency in marketing management. This article aims to guide aspiring candidates through the intricate web of exam objectives, ensuring they embark on their certification journey with clarity and confidence.

0
29/12/2023 07:03:38
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.