C |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
| #include <stdio.h>
#include <sys/time.h>
#include <stdio.h>
int count = 0;
struct tm the_date, * ptr_date;
time_t the_time;
int i;
void findd(void) {
the_time = mktime(&the_date);
ptr_date = localtime(&the_time);
if ( ptr_date->tm_wday == 5 )
count++;
if (the_date.tm_year < 2010) {
if (the_date.tm_mon < 12) {
the_date.tm_mon++;
}
else {
the_date.tm_year++;
the_date.tm_mon = 0;
}
findd();
}
}
int main(void){
the_date.tm_sec = 1;
the_date.tm_min = 0;
the_date.tm_hour = 0;
the_date.tm_mday = 13;
the_date.tm_mon = 0;
the_date.tm_year = 1900;
findd();
printf("%d", count);
return 0;
} |
|
Писали на Линуксе, подскажите что исправить чтоб заработала. А то хочет работать.
Добавлено через 3 часа 9 минут
Не хочет на Винде работать.
Добавлено через 6 часов 29 минут
выдаёт ошибку с EXE