1 / 5

Επιλυση Προβληματος με Εκλογη

Επιλυση Προβληματος με Εκλογη.

lan
Télécharger la présentation

Επιλυση Προβληματος με Εκλογη

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Επιλυση Προβληματος με Εκλογη • Δεδομενων την μερα, μηνα και χρονο σε αριθμητικη μορφη, υπολογιστε και τυπωστε το ονομα του μηνα, την μερα του μηνα, τον χρονο, και την μερα του χρονου. Πχ για 15 3 1987, η εξοδος πρεπει να ειναι 15 Martiou 1987 Mera 74. Εαν τα δεδομενα ειναι για δισεκτο χρονο, οπως 15 3 2000, τοτε η εξοδος θα ειναι 15 Martiou 2000 Mera 75.

  2. Επιλυση Προβληματος με Εκλογη προβλημα Υπολογισμος μερας χρονου Διαβασε μερα,μηνα,χρονο Τυπωσε, μερα, ονομα μηνα, χρονο και μερα χρονου Μερες προηγουμενων μηνων Ελεγχος για δισεκτο χρονο

  3. /* ypologismos meras xronoy */ mera_xronoy = meres_pou_perasan(minas); + mera_mina; if (disektos_xronos(year) && minas>2) mera_xronoy = mera_xronoy + 1;

  4. /* pairnei ton mina toy xronoy kai ypologizei kai epistrefei tis meres pou perasan stoys proigoumenous mines */ int meres_pou_perasan(int minas) { int meres; /* meres proigoumenwv minwn*/ /* 1 0, 2 31, 3 59, 4 90 ktl */ switch(month){ case 1: meres = 0; break; case 2: meres = JAN_DAYS; break; case3: meres = JAN_2_FEB_DAYS; break; …………………. case 12: meres = JAN_2_NOV_DAYS; } return meres;}

  5. /* orirmos statherwn gia meres mexri to telos enos mina apo ton ian*/ #define JAN_DAYS 31 #define JAN_2_FEB_DAYS JAN_DAYS+28 #define JAN_2_MAR_DAYS JAN_2_FEB_DAYS+31 #define JAN_2_APR_DAYS JAN_2_MAR_DAYS+30 #define JAN_2_MAY_DAYS JAN_2_APR_DAYS+31 #define JAN_2_JUN_DAYS JAN_2_MAY_DAYS+30 #define JAN_2_JUL_DAYS JAN_2_JUN_DAYS+31 #define JAN_2_AUG_DAYS JAN_2_JUL_DAYS+31 #define JAN_2_SEP_DAYS JAN_2_AUG_DAYS+30 #define JAN_2_OCT_DAYS JAN_2_SEP_DAYS+31 #define JAN_2_NOV_DAYS JAN_2_OCT_DAYS+30

More Related