Loading...

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

Lyubomir_92 avatar Lyubomir_92 0 Точки

More Exercises: Lists/ 03 Take/Skip Rope / Проблем с Judge

Здравейте,

Имам следния проблем с тази задача реших я и всичко работи ОК с примерните вх. от условието на Visual Studio, но когато я пратя на Judge ми дава Compile time error и следния текст: 

Compiled file is missing. Compiler output: ...\tmp6F1.tmp(53,35): error CS1503: Argument 1: cannot convert from 'System.Text.StringBuilder' to 'char[]'

Ето моето решение : https://pastebin.com/fJ9ZaqRm

Ето и условието:

Write a program, which reads a string and skips through it, extracting a hidden message. The algorithm you have to implement is as follows:
Let’s take the string “skipTest_String044160” as an example.
Take every digit from the string and store it somewhere. After that, remove all the digits from the string. After this operation, you should have two lists of items: the numbers list and the non-numbers list:
Numbers list: [0, 4, 4, 1, 7, 0]
Non-numbers: [s, k, i, p, T, e, s, t, _, S, t, r, i, n, g]
After that, take every digit in the numbers list and split it up into a take list and a skip list, depending on whether the digit is in an even or an odd index:
Numbers list: [0, 4, 4, 1, 7, 0]
Take list: [0, 4, 7]
Skip list: [4, 1, 0]
Afterwards, iterate over both of the lists and skip {skipCount} characters from the non-numbers list, then take {takeCount} characters and store it in a result string. Note that the skipped characters are summed up as they go. The process would look like this on the aforementioned non-numbers list:
Take 0 characters  Taken: "", skip 4 characters (total 0)  Skipped: "skipTest_String" Result: ""
Take 4 characters Taken: "Test", skip 1 characters (total 4)  Skipped: "skip"  Result: "Test"
Take 7 characters Taken: "String", skip 0 characters (total 9) Skipped: ""  Result: "TestString"
After that, just print the result string on the console.
Input
First line: The encrypted message as a string
Output
First line: The decrypted message as a string
Constraints
The count of digits in the input string will always be even.
The encrypted message will contain any printable ASCII character.
Examples
Input    Output
T2exs15ti23ng1_3cT1h3e0_Roppe    TestingTheRope
O{1ne1T2021wf312o13Th111xreve!!@!    OneTwoThree!!!
this forbidden mess of an age rating 0127504740    hidden message
 

Тагове:
0
Fundamentals Module 25/02/2019 13:54:14
DeeDee.ag avatar DeeDee.ag 6 Точки

Оставям две решения на задачата:

https://pastebin.com/xH5UMAEK
https://pastebin.com/TPknt6Dd

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