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 798441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:58:15+00:00 2026-05-14T22:58:15+00:00

I have this task and i can’t figure out how to do it. I

  • 0

I have this task and i can’t figure out how to do it.
I need to find persons age in days, there are given birth and death dates, there’s data file:

8   
Albertas Einšteinas     1879 03 14 1955 04 18         
Balys Sruoga            1896 02 02 1947 10 16  
Antanas Vienuolis       1882 04 07 1957 08 17   
Ernestas Rezerfordas    1871 08 30 1937 10 17   
Nilsas Boras            1885 10 07 1962 11 18   
Nežiniukas Pirmasis        8 05 24    8 05 25  
Nežiniukas Antrasis      888 05 25  888 05 25   
Nežiniukas Trečiasis       1 01 01  125 01 01

and there’s how result file should look like:

1879 3 14 1955 4 18 27775
1896 2 2 1947 10 16 18871
1882 4 7 1957 8 17 27507
1871 8 30 1937 10 17 24138
1885 10 7 1962 11 18 28147
8 5 24 8 5 25 1
888 5 25 888 5 25 0
1 1 1 125 1 1 45260

Few things to notice: all februarys have 28 days.
My function for calculating age:

  function AmziusFunc(Mas : TZmogus) : longint;
    var amzius, max : longint;
  begin
    max := 125 * 365;
    amzius := (Mas.mirY - Mas.gimY) * 365 + (Mas.mirM - Mas.gimM) * 31 +
      (Mas.mirD - Mas.gimD);
    if ( amzius >= max ) then amzius := 0;
    AmziusFunc := amzius;
  end;

What should i change there? Thanks.

  • 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-05-14T22:58:16+00:00Added an answer on May 14, 2026 at 10:58 pm
     function AmziusFunc(Mas : TZmogus) : longint;
        var amzius, max : longint;
      begin
        max := 125 * 365;
        amzius := (Mas.mirY - Mas.gimY) * 365 + (Mas.mirM - Mas.gimM) * 31 +
          (Mas.mirD - Mas.gimD);
        if ( amzius >= max ) then amzius := 0;
        AmziusFunc := amzius;
      end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this Task model: class Task < ActiveRecord::Base acts_as_tree :order => 'sort_order' end
For customer service week this year, I have the privileged task of creating a
I have this idea for a free backup application. The largest problem I need
I have this setup where in my development copy I can commit changes on
I have this task for the project with 4 nested subprojects using Maven: For
I'm making a task-based program that needs to have plugins. Tasks need to have
Suppose I have this data: Employee Task IsCurrent -------- ---- --------- Jeff 1 Yes
Any of you gone through this task? Please tell me a solution. I have
I have XML (see below). I need to insert the records in this XML
I have this code in jQuery, that I want to reimplement with the prototype

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.