#include
main()
{
int a,b,c;
printf("please input year and yue\n");
scanf("%d%d",&a,&b);
if((a%400)==0||(a%4)==0)
{
switch(b)
{
case 1:printf("31 days\n");break;
case 2:printf("29 days\n");break;
case 3:printf("31 days\n");break;
case 4:printf("30 days\n");break;
case 5:printf("31 days\n");break;
case 6:printf("30 days\n");break;
case 7:printf("31 days\n");break;
case 8:printf("31 days\n");break;
case 9:printf("30 days\n");break;
case 10:printf("31 days\n");break;
case 11:printf("30 days\n");break;
case 12:printf("31 days\n");break;
}
}
else
{
switch(b)
{
case 1:printf("31 days\n");break;
case 2:printf("28 days\n");break;
case 3:printf("31 days\n");break;
case 4:printf("30 days\n");break;
case 5:printf("31 days\n");break;
case 6:printf("30 days\n");break;
case 7:printf("31 days\n");break;
case 8:printf("31 days\n");break;
case 9:printf("30 days\n");break;
case 10:printf("31 days\n");break;
case 11:printf("30 days\n");break;
case 12:printf("31 days\n");break;
}
}
}
-------------------------------------------------------------------
-------------------------------------------------------------------
#include
main()
{
float xiaoshou,nashui;
printf("please input xiao shou e.....\n");
scanf("%f",&xiaoshou);
if(xiaoshou<10)
{
nashui=0.1;
printf("na shui%f\n",nashui);
}
else if(xiaoshou>10&&xiaoshou<=100)
{
nashui=xiaoshou*0.05;
printf("na shui%f\n",nashui);
}
else if (xiaoshou>100&&xiaoshou<500)
{
nashui=xiaoshou*0.05-10;
printf("na shui%f\n",nashui);
}
else if(xiaoshou>=500&&xiaoshou<=1000)
{
nashui=xiaoshou*0.05-30;
printf("na shui%f\n",nashui);
}
else
{
nashui=xiaoshou*0.05-50;
printf("na shui%f\n",nashui);
}
}
阅读(1201) | 评论(0) | 转发(0) |