列表

详情


NC216028. 2020

描述

2020年已经过去了,那么作为最简单的题就输出一个由‘0’和‘_’字符组成的巨大的2020吧。

输入描述

输出描述

输出2020字符画。

原站题解

上次编辑到这里,代码来自缓存 点击恢复默认模板

PHP 解法, 执行用时: 8ms, 内存消耗: 2844K, 提交时间: 2021-11-18 19:30:06

0000000000__0000000000__0000000000__0000000000
_________0__0________0___________0__0________0
_________0__0________0___________0__0________0
_________0__0________0___________0__0________0
0000000000__0________0__0000000000__0________0
0___________0________0__0___________0________0
0___________0________0__0___________0________0
0___________0________0__0___________0________0
0000000000__0000000000__0000000000__0000000000

C++(clang++11) 解法, 执行用时: 3ms, 内存消耗: 256K, 提交时间: 2021-01-08 08:50:42

#include<stdio.h>
int main()
{
	printf("0000000000__0000000000__0000000000__0000000000\n");
	for(int i=0;i<3;i++)
	printf("_________0__0________0___________0__0________0\n");
	printf("0000000000__0________0__0000000000__0________0\n");
	for(int i=0;i<3;i++)
	printf("0___________0________0__0___________0________0\n");
	printf("0000000000__0000000000__0000000000__0000000000");
	return 0;
	
}

C(clang11) 解法, 执行用时: 2ms, 内存消耗: 364K, 提交时间: 2021-01-08 08:49:12

#include <stdio.h>
int main()
{
	int m;
	for(m=0;m<9;m++)
	{
		if(m==0||m==8)
			printf("0000000000__0000000000__0000000000__0000000000\n");
		if(m==4)
			printf("0000000000__0________0__0000000000__0________0\n");
		if(m>0&&m<4)
			printf("_________0__0________0___________0__0________0\n");
		if(m>4&&m<8)
			printf("0___________0________0__0___________0________0\n");
	}
	return 0;
}

上一题