Skip to content

Instantly share code, notes, and snippets.

@Matrixbirds
Last active December 24, 2018 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Matrixbirds/e00aac9927efc6941af89fd1e29ce221 to your computer and use it in GitHub Desktop.
Save Matrixbirds/e00aac9927efc6941af89fd1e29ce221 to your computer and use it in GitHub Desktop.
Merry-Christmas.cxx
# include <iostream>
using namespace std;
/********* Merry Christmas :P *******/
int
main(){
int a
;
cin
>>a;int
w=a*2+5;for
(int x=
0;x<a;++x){
for(int y=2;y>=
0;--y){for(int z=0;
z<a+y-x;++z
){cout<<" ";}for(
int z=0;z<x*2-y*2+5;++z
){cout<<".";}cout
<<endl;}}for(int x=0;
x<w/5+1;++x){for(int z=0;
z<w/3+1;++z){cout<<" ";}for(
int z=0; z<w-(w/3+1)*2;z+=1){cout
<<"#";}cout
<<endl;;;}}
// g++ -o obj ./christmas_tree.cxx
# include <iostream>
using namespace std;
/********* Merry Christmas :P *******/
int
main(){
int a
;
cin
>>a;int
w=a*2+5;for
(int x=
0;x<a;++x){
for(int y=2;y>=
0;--y){for(int z=0;
z<a+y-x;++z
){cout<<" ";}for(
int z=0;z<x*2-y*2+5;++z
){cout<<"🎄";}cout
<<endl;}}for(int x=0;
x<w/5+1;++x){for(int z=0;
z<w/3+1;++z){cout<<" ";}for(
int z=0; z<w-(w/3+1)*2;z+=1){cout
<<"🐰";}cout
<<endl;;;}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment