#include <stdio.h>
#include <stdlib.h>
void f(int year)
{
char* x[] = {"甲","乙","丙","丁","戊","己","庚","辛","壬","癸"};
char* y[] = {"子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"};
int n = year - 1984;
while(n<0) n += 60;
printf("%s%s\n", x[n%10], y[n%12]);
}
int main(int argc, char* argv[])
{
f(1911);
f(1970);
f(2012);
return 0;
}
蓝桥杯真题刷题之28.千支纪年
最新推荐文章于 2024-11-04 22:26:34 发布