每天三题系列之杭电OJ 2003 2004 2005

include<iostream>//2003
#include<cmath>
#include<iomanip>
using namespace
std;
int
main ()
{

    double
a;
    while
(cin>>a)
        cout<<fixed << setprecision(2)<<abs(a)<<endl;
}

#include<iostream>//2004
using namespace
std;
int
main ()
{

    int
a;
    while
(cin>>a)
    {

        if
(a<=100&&a>=90)
            cout<<"A"<<endl;
        else if
(a>=80&&a<=89)
            cout<<"B"<<endl;
        else if
(a>=70&&a<=79)
            cout<<"C"<<endl;
        else if
(a>=60&&a<=69)
            cout<<"D"<<endl;
        else if
(a>=0&&a<=59)
            cout<<"E"<<endl;
        else
cout<<"Score is error!"<<endl;
    }

    return
0;
}

#include<iostream>//2005
using namespace
std;
int
main ()
{

    int
a,b,c;
    char
d;
    while
(cin>>a>>d>>b>>d>>c)
    {

        int
e=0;
        switch
(b)
        {

        case
12:e+=30;
            case
11:e+=31;
            case
10: e+=30;
            case
9: e+=31;
            case
8: e+=31;
            case
7: e+=30;
            case
6: e+=31;
            case
5: e+=30;
            case
4: e+=31;
            case
3: if((a%4==0&&a%100!=0)||(a%400==0))
                     e+=29;
                    else
e+=28;
            case
2: e+=31;

        }

        cout<<e+c<<endl;
    }

    return
0;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值