📜 ⬆️ ⬇️

C #: Etudes, Part 5

Habrayuzyry found a solution to the previous etude , but I decided in addition to demonstrate my own (ibid.)

We’ll stop with the internals of .NET, because inventing a study on this topic turned out to be somewhat more complicated than I thought: there is a lack of an element of surprise, a feeling of "unsolvability" of the task.

In today's problem, I hope this will be all right :)

')
So, here's a little program:
using System;<br> using System.Threading;<br><br> class App<br>{<br><br> static void DoSmth()<br>{<br> // TODO : Add code here <br>}<br><br> static void Main()<br>{<br> try <br> {<br> Console .WriteLine( "veni" );<br> DoSmth();<br> }<br> catch (ThreadAbortException)<br> {<br> Console .WriteLine( "vidi" );<br> }<br> Console .WriteLine( "vici" );<br>}<br>} <br><br> * This source code was highlighted with Source Code Highlighter .


It is necessary to print all three words (veni, vidi, vici) in the same order. No games with the console, adding new WriteLine , overriding ThreadAbortException not allowed. Also, you can not change the code Main. Focus on DoSmth() , the solution can be found there :)


I wish good luck to all!

Source: https://habr.com/ru/post/77829/


All Articles