ACM模版

描述

描述
描述

题解

没猜错的话,这个应该是签到题吧~~~

代码

#include <iostream>

using namespace std;

char map[8][8] = {
  "+-----+",
                  "| G|",
                  "| |",
                  "| |",
                  "| |",
                  "| |",
                  "+-----+"};

int main(int argc, const char * argv[])
{
    int d;
    cin >> d;
    if (d >= 90)
    {
        map[1][4] = '4';
    }
    else if (d >= 60)
    {
        map[1][4] = '3';
    }
    else
    {
        map[1][5] = 'E';
    }

    printf("%s\n", map[0]);
    int cnt = 1;
    while (d >= 20)
    {
        for (int i = 1; i <= cnt; i++)
        {
            map[cnt][i] = '-';
        }
        printf("%s\n", map[cnt++]);
        d -= 20;
    }
    for (int i = cnt; i < 7; i++)
    {
        printf("%s\n", map[i]);
    }

    return 0;
}