自己写了个for循环的淫荡程序.
#include <stdio.h>#include "string.h"
#include "conio.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++)//总共输出8次图象,造成动画效果//
{
for(j=12-i;j<=16-i;j++)
{
strcpy(a[j],a[j+1]);
}
strcpy(a[j]," ( ) ");
pr(a);
Sleep(1*10);
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--)//总共输出8次图象,造成动画效果//
{
for(j=10-i;j>=7-i;j--)
{
strcpy(a[j],a[j-1]);
}
strcpy(a[j]," ( ) ");
pr(a);
Sleep(1*10);
system("cls");
}
}
main()
{
int i,j;
for(i=0;i<=10;i++)
{
pr1();
system("cls");
pr2();
}
}
呵呵..从那个fuckMS的程序看完后不知道代码怎么实现,自己写了一个.
只是简单的实现下效果,有个疑问是,怎么才能在两个函数调用时不产生短暂的空白呢?我这个pr1和pr2函数连接时候有个空白感觉不是很好.
搜索更多相关的解决方案:
include
----------------解决方案--------------------------------------------------------
你看可不可以把Sleep()函数的暂停改小一点,比如Sleep(1)吧。
效果还行吧~~~~
----------------解决方案--------------------------------------------------------
这是全部的代码。呵呵。
//这搞了两天!! 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);
}
----------------解决方案--------------------------------------------------------
呵呵,挺强嘛
----------------解决方案--------------------------------------------------------
看不懂 观光旅游玩下
----------------解决方案--------------------------------------------------------
什么啊!
看不懂呢!----------------解决方案--------------------------------------------------------
嘿嘿,挺好玩的!
----------------解决方案--------------------------------------------------------
#include<stdio.h>
#include <stdlib.h>
char *a[]={
" /#\\ ",
" ##### ",
" ( ) "
};
char *b[]={
" ( )DD ",
" C=(=)==\\",
" C=(=)= |",
" C=(=)= |",
" C=(=)= /",
};
char *c=" ( ) ";
char *d[]={
" ( ) ",
" @@BBB@@ ",
" @@@@@@@ "
};
void p(char** str,int len){
for(;len;len--)
printf("%s\n",*str++);
}
#define PART1 p(a,3)
#define PART2 p(b,5)
#define PART3 for(int zz=5;zz;zz--)p(&c,1)
#define PART4 p(d,3)
void main(){
for(;;){
system("cls");
PART1;
PART2;
PART3;
PART4;
_sleep(100);
system("cls");
PART1;
PART3;
PART2;
PART4;
_sleep(100);
}
system("pause");
}
给个例子给你们……无语了,写效率那么低的程序……
----------------解决方案--------------------------------------------------------
呵呵,感谢"starwing"的提示,毕竟c刚学了一个月,之前也没学过其他编程语言,这东西还是利用课于时间自己想出来的.效率确实很底.不过能实现就很抖骚了.
----------------解决方案--------------------------------------------------------
还要int zz;
----------------解决方案--------------------------------------------------------