c语言用switch实现输入出生年份,输出属相
c语言用switch实现输入出生年份,输出属相
日期:2022-04-09 18:58:06 人气:1
简单代码如下:
思路输入年份去对12取余得出余数就可以知道属相。
#include<stdio.h>
int main()
{
int year, t;
scanf ("%d", &year);
t = year%12;
switch(t){
case 0:
思路输入年份去对12取余得出余数就可以知道属相。
#include<stdio.h>
int main()
{
int year, t;
scanf ("%d", &year);
t = year%12;
switch(t){
case 0: