Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- using namespace std;
- int main(int argc, char **argv)
- {
- int n, day, month = 0, months[13] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365};
- cout << "Lūdzu ievadiet dienas vērtību no 1-365: ";
- cin >> n;
- while (n > 3) {
- n -= 365;
- }
- while (months[month] < n) {
- month++;
- }
- day = n - months[month-1];
- cout << n << " Diena būs " << day << "." << month << ".2005" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement