Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7937387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:30:42+00:00 2026-06-03T22:30:42+00:00

Hello i’v got simple program which is couting characters in given text until line

  • 0

Hello i’v got simple program which is couting characters in given text until line is empty line only with new line

var
  znaki: array['a'..'z'] of integer = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
  napis: String;
  maly: String;
  dlugosc: Integer;
  znak: char;


begin
napis := 'a';
while napis[1] <> '#13#10'do
begin
  readln(napis);
  maly:=LowerCase(napis);
  for dlugosc:=(length(maly)) downto 1 do
begin
znaki[maly[dlugosc]]:=znaki[maly[dlugosc]]+1;
  end;
  for znak:='a' to 'z' do
    writeln(znak, ' ', znaki[znak]);
  end;

end.  

it fails on while condtion and i dont know why.
Pleas give me clue

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:30:44+00:00Added an answer on June 3, 2026 at 10:30 pm

    One char, napis[1]; can’t be 2 chars #13 & #10…

    So, I’ll do this for example:

    var
      znaki: array['a'..'z'] of integer = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
      napis: String;
      maly: String;
      dlugosc: Integer;
      znak: char;
    
    
    begin
    napis := 'a';
    while ((Length(napis) > 0)) do
    begin
      readln(napis);
    //  napis := StringReplace(napis, #13#10, #10, [rfReplaceAll]);  //useless for a console readln
      maly:=LowerCase(napis);
      for dlugosc:=(length(maly)) downto 1 do
      begin
        znaki[maly[dlugosc]]:=znaki[maly[dlugosc]]+1;
      end;
      for znak:='a' to 'z' do
        writeln(znak, ' ', znaki[znak]);
    end;
    end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello i'm studying iOS programming i created a project, which is an empty application
Hello I have a table on which I have denied SELECT privs to a
Hello I have the following code namespace ConsoleApplication2 { class Program { static void
Hello! I would like to extract all citations from a text. Additionally, the name
Hello I wrote an application and while deploying shows error in line mCamera=Camera.open(); Where
Hello , I am using arshaw fullcalendar v1.5.2 (only month view ) for property
Hello i have a TextField on my scene. It haves only digits, user input
Hello i have this code var queue = new BlockingCollection<int>(); queue.Add(0); var producers =
Hello I am making this call: $parts = $structure->parts; Now $structure only has parts
hello im am getting JS error : Uncaught SyntaxError: Unexpected identifier here <script type=text/javascript>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.