[Offer收割]编程练习赛36 register

Ended

Participants:242

Verdict:Accepted
Score:100 / 100
Submitted:2017-11-19 13:16:52

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
#include <stdlib.h>
using namespace std;
void printchar(int n, char c)
{
    for(int i = 0; i < n; i++)
    {
        printf("%c", c);
    }
}
void love(int n)
{
    printchar(n, ' ');
    printchar(n, '_');
    printchar(3*n, ' ');
    printchar(n, '_');
    printf("\n");
    for(int i = 0; i < n; i++)
    {
        printchar(n-i-1, ' ');
        printf("/");
        printchar(n+2*i, ' ');
        printf("\\");
        if(i == n-1)
            printchar(3*n-2-2*i, '_');
        else
            printchar(3*n-2-2*i, ' ');
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX