|
5啊哈币
- #include <stdio.h>
- #include <stdlib.h>
- #include <windows.h>
- int gotoxy(int x,int y)
- {
- COORD c;
- c.X=x-1;
- c.Y=y-1;
- SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
- }
- int main()
- {
- struct point
- {
- int x,y;
- int xv,yv;
- }man;
- long p;
- man.X = man.Y=20;
- man.XV = man.YV=1;
- system("cls");
- p=1000000000000000;
- while (p--)
- {
- if (p%50000)
- continue;
- gotoxy(man.X,man.Y);
- printf(" ");
- man.X += man.XV;
- man.Y += man.YV;
- if (man.X==0|man.X==80)
- man.YV*=-1;
- if (man.Y==0|man.Y==80)
- man.YV*=-1;
- gotoxy(man.X,man.Y);
- printf("%c",2);
- }
- getchar();
- return 0;
- }
复制代码 |
|