用C++写“生日快乐”祝福

#include<iostream>
using namespace std;
int main()
{	system("chcp 437");			//这样才能正确输出ascall码而不会输出乱码 
	char a=178;
	cout<<'\n'<<'\n';

//以下数字皆为行数	
	cout<<"   "<<" "<<"  "<<a;
								
	for(int i=1;i<=5;i++)
	{	cout<<" ";				
	}
	for(int i=1;i<=9;i++)
	{	cout<<" ";				
	}							//1
	
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}
	for(int i=1;i<=11;i++)
	{	cout<<" ";				//1
	}
					
	
	cout<<" "<<a;
	for(int i=1;i<=5;i++)
	{	cout<<' ';
	}
	cout<<a;
	cout<<"    ";
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}							//1
	
	cout<<"  ";
	for(int i=1;i<=7;i++)
	{	cout<<a;
	}
	cout<<'\n';					//1
	
	
	cout<<"  "<<a<<"   "<<a;
	for(int i=1;i<=5;i++)
	{	cout<<" ";				
	}
	for(int i=1;i<=9;i++)
	{	cout<<" ";				
	}				            //2
	
	cout<<"  ";
	for(int i=1;i<=9;i++)
	{	cout<<a;
	}
	
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				            //2
	
	cout<<" "<<a;
	for(int i=1;i<=5;i++)
	{	cout<<' ';
	}
	cout<<a;
	cout<<"    ";
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                //2
	
	cout<<a<<"    "<<a;
	cout<<'\n';						//2
	
	
	cout<<" "<<a<<"    "<<a;
	for(int i=1;i<=5;i++)
	{	cout<<" ";				
	}
	for(int i=1;i<=9;i++)
	{	cout<<" ";				
	}				                //3
	
	
	cout<<"  "<<a;
	for(int i=1;i<=7;i++)
	{	cout<<" ";
	}
	cout<<a;
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                //3
	
		cout<<" "<<a<<"  ";
	for(int i=1;i<=7;i++)
	{	cout<<a;
	}
	cout<<" ";
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                //3
	
	cout<<a<<"    "<<a;
	cout<<'\n';						//3
	
	
	cout<<a<<" ";
	for(int i=1;i<=9;i++)
	{	cout<<a;
	}
	cout<<" ";
	
	for(int i=1;i<=9;i++)
	{	cout<<" ";				
	}				                //4
	
	cout<<"  "<<a;
	for(int i=1;i<=7;i++)
	{	cout<<" ";
	}
	cout<<a;
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                //4
	
	cout<<" "<<a;
	for(int i=1;i<=5;i++)
	{	cout<<" ";
	}
	cout<<a<<"  "<<a;
	cout<<" ";
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}							    //4
	
	cout<<a<<"    "<<a;
	cout<<'\n';						//4
	
	
	for(int i=1;i<=6;i++)
	{	cout<<" ";
	}
	cout<<a;
	for(int i=1;i<=5;i++)
	{	cout<<" ";				
	}
    for(int i=1;i<=9;i++)
	{	cout<<" ";				
	}				                   //5
	
	cout<<"  "<<a;
	for(int i=1;i<=7;i++)
	{	cout<<" ";
	}
	cout<<a;
    for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                    //5
	
	
	cout<<a<<a<<a;
	for(int i=1;i<=4;i++)
	{	cout<<" ";
	}
	cout<<a<<"  "<<a;
	cout<<" ";
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                    //5
	
	for(int i=1;i<=11;i++)
	{	cout<<a;
	} 
	cout<<'\n';						      //5
	
		
		
	for(int i=1;i<=6;i++)
	{	cout<<" ";
	}
	cout<<a;
	for(int i=1;i<=5;i++)
	{	cout<<" ";				
	}
	for(int i=1;i<=9;i++)
	{	cout<<" ";				
	}				                        //6
	
	
	cout<<"  ";
	for(int i=1;i<=6;i++)
	{	cout<<a;
	}
	cout<<"  "<<a;
    for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                        //6
	
	
	for(int i=1;i<=13;i++)
	{	cout<<a;
	}	
    for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                        //6
	
	cout<<"    "<<a;
	cout<<'\n';						        //6
	
	
	cout<<"   ";
	for(int i=1;i<=7;i++)
	{	cout<<a;
	}
	cout<<"  ";
    for(int i=1;i<=9;i++)
	{	cout<<" ";				
	}					                    //7
	
	cout<<"  "<<a;
	for(int i=1;i<=7;i++)
	{	cout<<" ";
	}
	cout<<a;
    for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                          //7
	
	cout<<" "<<a<<"    "<<a<<" "<<a;
	cout<<"   ";
    for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                        //7
	
	cout<<"  "<<a<<"  "<<a<<"  "<<a;
	cout<<'\n';						        //7
	
		for(int i=1;i<=6;i++)
	{	cout<<" ";
	}
	cout<<a;
	for(int i=1;i<=5;i++)
	{	cout<<" ";				
	}
	for(int i=1;i<=9;i++)
	{	cout<<" ";				
	}				                        //8
	
		cout<<"  "<<a;
	for(int i=1;i<=7;i++)
	{	cout<<" ";
	}
	cout<<a;
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                        //8
	
	cout<<" "<<a<<"   "<<a<<"   "<<a;
	cout<<"  "; 
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                        //8
	
	cout<<" "<<a<<"   "<<a<<"   "<<a;
	cout<<'\n';						        //8
	
	
		for(int i=1;i<=6;i++)
	{	cout<<" ";
	}
	cout<<a;
	for(int i=1;i<=5;i++)
	{	cout<<" ";				
	}
    for(int i=1;i<=9;i++)
	{	cout<<" ";				
	}				                        //9
	
		cout<<"  ";
	for(int i=1;i<=9;i++)
	{	cout<<a;
	}
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}							                //9
	
	cout<<" "<<a<<"  "<<a<<"     "<<a; 
	cout<<" ";
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				                            //9
	
	cout<<a<<"    "<<a<<"    "<<a;
	cout<<'\n';						            //9
	
	
	cout<<" ";
	for(int i=1;i<=11;i++)
	{	cout<<a;
	}
	for(int i=1;i<=9;i++)
	{	cout<<" ";				
	}							                    //10 
	
	
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}				
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}								                //10 
		
	cout<<" "<<a<<" "<<a<<"       "<<a;		
	for(int i=1;i<=11;i++)
	{	cout<<" ";				
	}								                //10
		
	cout<<"     "<<a;
	cout<<'\n';						                //10
	
	
	return 0;	
}

效果如图:

评论 17
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值