这是全部的代码。呵呵。
//这搞了两天!! by-dousao//
#include "stdio.h"
#include "string.h"
#include "windows.h"
#include "stdlib.h"
pr(char (*p)[13]) //输出交换后的图象的内容!//
{
int i;
for(i=0;i<=19;i++)
{
printf("%s\n",p[i]);
}
}
pr1()
{
int i,j,k;
char a[20][13]={
" ", //0
" ", //1
" ", //2
" ", //3
" /#\\ ", //4
" ##### ", //5
" ( ) ", //6
" ( ) ", //7
" ( ) ", //8
" ( ) ", //9
" ( ) ", //10
" ( ) ", //11
" ( ) ", //12
" ( )DD ", //13
" C=(=)==\\", //14
" C=(=)= |", //15
" C=(=)= |", //16
" C=(=)= /", //17
" @@BBB@@ ", //18
" @@@@@@@ "}; //19
for(i=0;i<=6;i++)//总共输出6次图象,造成动画效果//
{
for(j=12-i;j<=16-i;j++)
{
strcpy(a[j],a[j+1]);
}
strcpy(a[j]," ( ) ");
pr(a);
Sleep(1*50);
system("cls");
}
}
pr2()
{
int i,j,k;
char *t1,*t2;
char a[20][13]={
" ", //0
" ", //1
" ", //2
" ", //3
" /#\\ ", //4
" ##### ", //5
" ( )DD ", //6
" C=(=)==\\ ", //7
" C=(=)= |", //8
" C=(=)= |", //9
" C=(=)= /", //10
" ( ) ", //11
" ( ) ", //12
" ( ) ", //13
" ( ) ", //14
" ( ) ", //15
" ( ) ", //16
" ( ) ", //17
" @@BBB@@ ", //18
" @@@@@@@ "}; //19
for(i=0;i>=-6;i--)//总共输出6次图象,造成动画效果//
{
for(j=10-i;j>=7-i;j--)
{
strcpy(a[j],a[j-1]);
}
strcpy(a[j]," ( ) ");
pr(a);
Sleep(1*50);
system("cls");
}
}
pr3()
{
int i,j,k;
char a[20][13]={
" ", //0
" o ", //1
" o ", //2
" o ", //3
" /#\\ ", //4
" ##### ", //5
" ( ) ", //6
" ( ) ", //7
" ( ) ", //8
" ( ) ", //9
" ( ) ", //10
" ( ) ", //11
" ( ) ", //12
" ( )DD ", //13
" C=(=)==\\", //14
" C=(=)= |", //15
" C=(=)= |", //16
" C=(=)= /", //17
" @@BBB@@ ", //18
" @@@@@@@ "}; //19
for(i=0;i<=6;i++)//总共输出6次图象,造成动画效果//
{
for(j=12-i;j<=16-i;j++)
{
strcpy(a[j],a[j+1]);
}
strcpy(a[j]," ( ) ");
pr(a);
Sleep(1*5);
system("cls");
}
}
pr4()
{
int i,j,k;
char *t1,*t2;
char a[20][13]={
" o ", //0
" o ", //1
" o ", //2
" o ", //3
" /#\\ ", //4
" ##### ", //5
" ( )DD ", //6
" C=(=)==\\ ", //7
" C=(=)= |", //8
" C=(=)= |", //9
" C=(=)= /", //10
" ( ) ", //11
" ( ) ", //12
" ( ) ", //13
" ( ) ", //14
" ( ) ", //15
" ( ) ", //16
" ( ) ", //17
" @@BBB@@ ", //18
" @@@@@@@ "}; //19
for(i=0;i>=-6;i--)//总共输出6次图象,造成动画效果//
{
for(j=10-i;j>=7-i;j--)
{
strcpy(a[j],a[j-1]);
}
strcpy(a[j]," ( ) ");
pr(a);
Sleep(1*5);
system("cls");
}
}
pr5()
{
int i,j,k;
char a[20][13]={
" ", //0
" o ", //1
" o ", //2
" ", //3
" /#\\ ", //4
" ##### ", //5
" ( ) ", //6
" ( ) ", //7
" ( ) ", //8
" ( ) ", //9
" ( ) ", //10
" ( ) ", //11
" ( ) ", //12
" ( )DD ", //13
" C=(=)==\\", //14
" C=(=)= |", //15
" C=(=)= |", //16
" C=(=)= /", //17
" @@BBB@@ ", //18
" @@@@@@@ "}; //19
for(i=0;i<=6;i++)//总共输出6次图象,造成动画效果//
{
for(j=12-i;j<=16-i;j++)
{
strcpy(a[j],a[j+1]);
}
strcpy(a[j]," ( ) ");
pr(a);
Sleep(1*5);
system("cls");
}
}
pr6()
{
int i,j,k;
char *t1,*t2;
char a[20][13]={
" o ", //0
" ", //1
" o ", //2
" ", //3
" /#\\ ", //4
" ##### ", //5
" ( )DD ", //6
" C=(=)==\\ ", //7
" C=(=)= |", //8
" C=(=)= |", //9
" C=(=)= /", //10
" ( ) ", //11
" ( ) ", //12
" ( ) ", //13
" ( ) ", //14
" ( ) ", //15
" ( ) ", //16
" ( ) ", //17
" @@BBB@@ ", //18
" @@@@@@@ "}; //19
for(i=0;i>=-6;i--)//总共输出6次图象,造成动画效果//
{
for(j=10-i;j>=7-i;j--)
{
strcpy(a[j],a[j-1]);
}
strcpy(a[j]," ( ) ");
pr(a);
Sleep(1*20);
system("cls");
}
}
pr7()
{
int i,j,k;
char a[20][13]={
" ", //0
" o ", //1
" o ", //2
" ", //3
" /#\\ ", //4
" ##### ", //5
" ( ) ", //6
" ( ) ", //7
" ( ) ", //8
" ( ) ", //9
" ( ) ", //10
" ( ) ", //11
" ( ) ", //12
" ( )DD ", //13
" C=(=)==\\", //14
" C=(=)= |", //15
" C=(=)= |", //16
" C=(=)= /", //17
" @@BBB@@ ", //18
" @@@@@@@ "}; //19
for(i=0;i<=6;i++)//总共输出6次图象,造成动画效果//
{
for(j=12-i;j<=16-i;j++)
{
strcpy(a[j],a[j+1]);
}
strcpy(a[j]," ( ) ");
pr(a);
Sleep(1*20);
system("cls");
}
}
main()
{ char *p="在没有老婆的日子里,你拿什么解决自己?";
char a[20][13]={
" ", //0
" o ", //1
" o ", //2
" ", //3
" /#\\ ", //4
" ##### ", //5
" ( ) ", //6
" ( ) ", //7
" ( ) ", //8
" ( ) ", //9
" ( ) ", //10
" ( ) ", //11
" ( ) ", //12
" ( )DD ", //13
" C=(=)==\\", //14
" C=(=)= |", //15
" C=(=)= |", //16
" C=(=)= /", //17
" @@BBB@@ ", //18
" @@@@@@@ "}; //19
int i,j,k;
for(i=0;i<=10;i++)
{
pr1();
system("cls");
pr2();
}
system("cls");
printf("\n\n\n\n");
for(j=0;j<=1;j++)
{
printf("\n\n\n\n");
pr3();
pr(a);
Sleep(800);
system("cls");
printf("\n\n\n\n");
pr4();
pr(a);
Sleep(800);
system("cls");
printf("\n\n\n\n");
pr5();
pr(a);
Sleep(800);
system("cls");
pr6();
}
for(k=0;k<strlen(p);k++)
{
printf("%c",*(p+k));
Sleep(50);
}
Sleep(10*1000);
}