noname01.cpp

来自「simulation for computer selection」· C++ 代码 · 共 56 行

CPP
56
字号
#include<iostream.h>
#include<graphics.h>
#include<conio.h>
#include<math.h>
#include<dos.h>
#include<stdio.h>
#include<stdlib.h>
 void call();
void main()
{
	int gm=VGAHI,gd=VGA,r=0;
	initgraph(&gd,&gm,"c:\\tc\\bgi");
	char ch;
	char *c;
	int lt=0,rt=0;
	for(int t=0;t<7;t++)
	{
	rectangle(95+lt,75,135+rt,105);
	     //	rectangle(125,75,155,105);
	     lt=lt+40;
	     rt=rt+40;
	}
	for(;;)
	{
	       fflush(stdin);
	       fflush(stdout);
	       ch=getch();
	       c=&ch;
	       moveto(105+r,65);
	       settextstyle(TRIPLEX_FONT,0,4);
	       setcolor(24);
	       outtext(c);
	       r+=40;
	      if(*c=='\r')
	      {
		break;
	      }
	 }

     call();

      getch();
  }
  void call()
  {
      int lt=0,rt=0;

      for(int t=0;t<7;t++)
	{
	 setfillstyle(1,BLACK);
	 bar(98+lt,76,132+rt,103);
	 lt=lt+40;
	 rt=rt+40;
	}

    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?