一个欲儿的博客

一个欲儿的博客

C++二维数组印桃心
2019-04-29

#include<stdio.h>





int map[10][10]{
    {0,0,0,0,0,0,0,0,0,0},
    {0,1,1,1,1,1,0,0,0,0},
    {1,0,0,0,0,0,1,0,0,0},
    {1,0,0,0,0,0,1,0,0,0},
    {0,1,0,0,0,1,0,0,0,0},
    {0,0,1,0,1,0,0,0,0,0},
    {0,0,0,1,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0},
};




void print()
{
	int x = 0;
	int y = 0;
	for(x=0;x<10;x++)
	{
		for(y=0;y<10;y++)
		{
		if(map[x][y] == 0)
		{
		printf("  "); 
		}
		else if(map[x][y] == 1)
		{
		printf("正"); 
		}
				
		
			
			
		}
		
		
		printf("\n");
		
	}
	
	
	
	
	
}






int main()
{
	
	print(); 
	
	
	
	
	
	
	while(1);
	return 0;
}


这是桃心

blob.png




发表评论: