搜索
查看: 197|回复: 1
打印 上一主题 下一主题

新人求助。。

[复制链接]
跳转到指定楼层
楼主
 楼主| 发表于 2019-4-14 19:32:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
5啊哈币
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <windows.h>
  4. int gotoxy(int x,int y)
  5. {
  6.     COORD c;
  7.     c.X=x-1;
  8.     c.Y=y-1;
  9.     SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
  10. }
  11. int main()
  12. {
  13.     struct point
  14.     {
  15.         int x,y;
  16.         int xv,yv;
  17.     }man;
  18.     long p;
  19.     man.X = man.Y=20;
  20.     man.XV = man.YV=1;
  21.     system("cls");
  22.     p=1000000000000000;
  23.     while (p--)
  24.     {
  25.         if (p%50000)
  26.         continue;
  27.         gotoxy(man.X,man.Y);
  28.         printf(" ");
  29.         man.X += man.XV;
  30.         man.Y += man.YV;
  31.         if (man.X==0|man.X==80)
  32.         man.YV*=-1;
  33.         if (man.Y==0|man.Y==80)
  34.         man.YV*=-1;
  35.         gotoxy(man.X,man.Y);
  36.         printf("%c",2);
  37.     }
  38.     getchar();
  39.     return 0;
  40. }
复制代码

沙发
发表于 2019-8-5 18:53:34 | 只看该作者
这是新人?连WINDOWS都用上了,开玩笑吧
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

广播台
特别关注
快速回复 返回顶部 返回列表