Connection ErrorBad RequestSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
Error Details:
Share Link
Posts from Need help with two problems in Turbo Pascal.
I would help you, but I'm pretty useless myself right now.
77.8%7 votes
Damn, I don't have time for this nonsense!
22.2%2 votes
Kash
Auto-translated
Fellow forum users, I need your help. I urgently need to solve two problems in Turbo Pascal, but I don't know anything about it. I tried to find ready-made solutions online, but it didn't work. I downloaded and read a textbook, but it was like talking to a brick wall :( If there is an enthusiast who is familiar with the language and can create at least one program, I will be extremely grateful.
1. To encrypt text written using Russian letters and punctuation marks, you can rewrite it by replacing each letter with the next letter in the alphabet (the letter "я" is replaced with "а"). a) Encrypt the given text. b) Decrypt the given text.
It's called the Caesar cipher, the most basic one. As I understand it, after running the program, it asks: What do you need? Encrypt or decrypt? (a or b) You answer it, enter the text, and it encrypts/decrypts. It seems to be solved in two ways: by linking to a character encoding table or by introducing an array consisting of Russian letters. The second method is preferable because encodings may differ (these are my newbie comments).
2. Given the characters s1, s2, ... It is known that the character s1 is different from the exclamation mark and that among s2, s3, ... there is at least one exclamation mark. Let s1, ..., sn be the characters of the given sequence preceding the first exclamation mark (n is unknown in advance). Determine whether it is true that among s1, ..., sn there are all the letters that make up the word "шина" (tire).
It's something similar.
The solution is needed by tonight, but there are possible options). Thank you for your attention, with hope in my voice, etc. :)
WhiteLizard
Auto-translated
I can't help, I'm as clueless as he is. Please, help him! *___*
За всем следят машины благодати и любви.
Imaris
Auto-translated
Actually, that third one from the top – that’s me.
I don’t know Pascal, if I did, I’d help.
Register on some forum where there are knowledgeable people, and ask there.
P.S. You wrote the topic title in such a noobish way that most of the creatures inhabiting the forum won’t even visit it.
You guys are flooding the chat... :)
Most of the creatures (including 1 wolf) have already checked out the thread, and we thank them for that.
One is diligently working on the first task, and we'll soon bring it to completion.
Maybe someone else will join in.
Imaris
Auto-translated
Oh, Cash, sorry, I just read the title of the poll and thought that was the topic name (I followed the link). I'm an idiot. P.S. And 1 Lizard has already checked it out!
The best help is advice! Write to those who create programs for Heroes of Might and Magic on ICQ. They will definitely figure it out.
Avern
Auto-translated
Solution to problem 2.
Perhaps it could have been done better, but I studied C++, not Pascal.
var str1:String; a,b,c,d,e:Integer; begin Write('Enter a string: '); ReadLn(str1); a:=pos('ш',str1); b:=pos('и',str1); c:=pos('н',str1); d:=pos('а',str1); e:=pos('!',str1); if (a < e) and (b < e) and (c < e) and (d < e) then Write('Hooray! The word will be formed') else Write ('It won't work'); ReadLn; end.
I assume the first problem has already been solved?
Thank you all very much for your sympathy and attempts to help :smile43:
And a huge thank you to Volodya, Hermit, for both tasks!
P.S. I just sent the solution to the girl (yes, it was for her, why did I need Pascal?), she complained that it was too complicated and not for first-year students, but I was forgiven - and that's great :)