Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2124206
  • 博文数量: 288
  • 博客积分: 10594
  • 博客等级: 上将
  • 技术积分: 3469
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-27 19:27
文章分类

全部博文(288)

文章存档

2012年(4)

2011年(30)

2010年(40)

2009年(32)

2008年(71)

2007年(79)

2006年(32)

分类:

2007-01-27 17:37:13

#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);
}
}
阅读(1196) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~