New Year's Day blessing procedures

#include<stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include<Windows.h>
#define X 25
#define I 20
#define R 340
int background[20][2 * X] = { 0 };
int SNOW = 30;


void tree()
{
int i, j, x, y;
for (i = 0; i < 3; i++)
{
y = i;
for (j = 0; j < 2 * i + 1; j++)
{
background[y][(X - i) + j] = 1;
}
}
for (i = 0; i < 5; i++)
{
y++;
for (j = 0; j < 2 * (i + 1) + 1; j++)
{
background[y][(X - (i + 1)) + j] = 1;
}
}
for (i = 0; i < 7; i++)
{
y++;
for (j = 0; j < 2 * (i + 3) + 1; j++)
{
background[y][(X - (i + 3)) + j] = 1;
}
}
for (i = 0; i < 5; i++)
{
y++;
for (j = 0; j < 3; j++)
{
background[y][X + (2 * j - 2)] = 2;
}
}
}


void snow()
{
int i;
srand(time(NULL));
for (i = 0; i < SNOW; i++)
{
int x, y;
x = rand() % (2 * X);
y = rand() % 20;
if ((background[y][x] == 0))
{
background[y][x] = 3;
}
}
}


void color(short x)
{
    if(x>=0 && x<=15)
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), x);
    else
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
}






void display()
{
int x, y;
long time;
for (y = 0; y < 20; y++)
{
for (x = 0; x < 2 * X; x++)
{
if (background[y][x] == 0)
{
printf(" ");
}
if (background[y][x] == 1)
{
    color(10);


printf("*");
}






if (background[y][x] == 2)
{
  color(14);
printf("*");
}
if (background[y][x] == 3)
{
      color(15);
printf("*");
}
}
printf("\n");




}






}


void clear_snow()
{
int i, j;
for (i = 0; i < 20; i++)
{
for (j = 0; j < 2 * X; j++)
{
if (background[i][j] == 3)
{
background[i][j] = 0;
}
}
}
}


void main()
{


system("title 元旦快乐 **同学");
int n=15,m;
int i , j,l ;
tree();


system("color 3F");
printf ( "**** Background to watch the entire process is not smooth your own brain make new new year **** Happy \ n");
at Sleep (2000);
System ( "Color 1F");
printf ( "embarrassed \ n") ; Sleep (2000); system ( "color 2C"); printf ( " embarrassed \ n"); Sleep (2000 ); system ( "color 4F"); printf ( " embarrassed \ n"); Sleep (2000 );
  System ( "CLS");
printf ( "(⊙ o ⊙) ... Please feel free to enter a number greater than 5 to properly appreciate this little program it ha ha ha this is a countdown tool:");
scanf ( "% d", & m) ;
System ( "Color. 3C");
the while (m> = 0)
{
    System ( "CLS");
    for (I = 0; I <20 is; I ++)
    {
        for (J = 0; J <20 is; J ++)
        {
            IF (J == I == 20 is || I + J)
                the printf ( "% D", m);
            else
                printf(" ");
        }
        printf("\n");
    }
    Sleep(1000);
    m--;
    }
     system("cls");




while (n>=0)
{


snow();
display();
Sleep(500);
n-- ;


system("cls");
clear_snow();


}
system("cls");
system("color 4F");


for(i=0;i<8;i++)
{
   for(l=0;l<i;l++)
   {
       printf("  ");
   }


   for(j=0;j<1;j++)
   {
         printf("happy new year!!\n");
   }
   printf(" \n");
   Sleep(1000);
}
     getchar();
for (I = 0; I <. 4; I ++)
{
    for (J = 0; J <. 1; J ++)
        the printf ( "\ n-");
}


the printf ( "Thanks 2017 meet with you \ n"); printf ( " \ the n-"); printf (" \ the n-"); at Sleep (2000);
printf (" willing to 2018. can you be more mature and self-confident, more joy and happiness \ n "); printf (" \ n "); printf ( "\ the n-"); at Sleep (2000);
printf ( "I wish you better 2018 !!! \ the n-"); at Sleep (2000);


System ( "CLS");


int E;
int A;
Long Time;


for (I =. 1, the I = A; I <the I / 2; I ++, A--)
{
for (J = (int) (the I-sqrt (the I-* the I (AI) * (AI))); J> 0; J,)
the printf ( "");
for (E =. 1; E <= 2 * sqrt (the I-* the I (AI) * (AI)); E ++)
the printf ( "\. 3");
for(j=(int)
( 2*( I-sqrt(I*I-(a-i)*(a-i)) ) );j>0;j--)
printf(" ");
for(e=1;e<=2*sqrt(I*I-(a-i)*(a-i));e++)
printf("\3");
printf("\n"); }
for(i=1;i<80;i++)
{
if(i==25)
{
printf("  2018  努力  奋斗  坚持 加油 ");
i+=30;
}
printf("\3");
}
printf("\n");
for(i=1;i<=R/2;i++)
{
if(i%2||i%3)
continue;
for(j=(int) ( R-sqrt(R*R-i*i) );j>0;j--)
printf(" ");
for(e=1;e<=2*( sqrt(R*R-i*i) - (R-2*I) );e++)
printf("\3");
printf("\n");
}


for(; ; )
{
system("color a");
for(time=0;time<99999999;time++); system("color b");
for(time=0;time<99999999;time++); system("color c");
for(time=0;time<99999999;time++); system("color d");
for(time=0;time<99999999;time++); system("color e");
for(time=0;time<99999999;time++); system("color f");
for(time=0;time<99999999;time++);
system("color 0"); for(time=0;time<99999999;time++);
system("color 1"); for(time=0;time<99999999;time++);
system("color 2"); for(time=0;time<99999999;time++);
system("color 3"); for(time=0;time<99999999;time++);
system("color 4");
for(time=0;time<99999999;time++); system("color 5");
for(time=0;time<99999999;time++); system("color 6");
for(time=0;time<99999999;time++); system("color 7");
for(time=0;time<99999999;time++); system("color 8");
for(time=0;time<99999999;time++); system("color 9");
for(time=0;time<99999999;time++); system("color ab");
for(time=0;time<99999999;time++); system("color ac");
for(time=0;time<99999999;time++); system("color ad");
for(time=0;time<99999999;time++); system("color ae");
for(time=0;time<99999999;time++); system("color af");
for(time=0;time<99999999;time++); }
return 0;




}
Published 19 original articles · won praise 8 · views 4151

Guess you like

Origin blog.csdn.net/paohui001lqp/article/details/78943956