This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| int DaysPerMonth(int numb, bool leap) { // Подсчет кол-ва дней в месяце. | |
| if ((numb == 1) || (numb == 3) || (numb == 7) || (numb == 5)) { | |
| return 31; | |
| } else if ((numb == 8) || (numb == 10) || (numb == 12)) { | |
| return 31; | |
| } else if ((numb == 4) || (numb == 6) || (numb == 9) || (numb == 11)) { | |
| return 30; | |
| } else if (leap == true) { | |
| return 29; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| void cycle(int& numbvec, const int cyclebegin, int& summ, std::vector<int>& MainVec) { | |
| if (MainVec[numbvec] == cyclebegin) { | |
| summ = summ + 1; | |
| MainVec[numbvec] = 0; | |
| } else { | |
| cycle(MainVec[numbvec], cyclebegin, summ, MainVec); | |
| MainVec[numbvec] = 0; |
NewerOlder