#include <stdio.h> struct date { int year; int month; int day; }; int main() { struct date test_day; scanf("%d %d %d", &test_day.year, &test_day.month, &test_day.day); int sum; sum = (test_day.month-1) * 30 + (test_day.month+1)/2 + test_day.day; if (test_day.year % 4 == 0) { sum--; } else { sum = sum - 2; } printf("%d", sum); } |
Double click to view unformatted code.