首页 > 其他分享 >使用队列实现QQ号

使用队列实现QQ号

时间:2023-03-17 14:44:06浏览次数:36  
标签:begin head 队列 tail queue 实现 QQ号

procedure TForm1.Button1Click(Sender: TObject);
var
  queue:TQueue;
  i:integer;
  s:string;
begin
  queue.head:=1;
  queue.tail:=1;
  for i:=1 to 9 do
    begin
       queue.data[queue.tail]:=strtoint(inputbox('请输入一个数吧','输入吧',''));
       queue.tail:=queue.tail+1;
    end;
 while(queue.head<queue.tail) do
    begin
      s:=s+inttostr(queue.data[queue.head]);
      showmessage(s);
      queue.head:=queue.head+1;
      queue.data[queue.tail]:=queue.data[queue.head];
      queue.head:=queue.head+1;
      queue.tail:=queue.tail+1;
    end;
 showmessage(s);
end;

 

标签:begin,head,队列,tail,queue,实现,QQ号
From: https://www.cnblogs.com/zhusd/p/17226748.html

相关文章

  • C# task和timer实现定时操作
    C#task和timer实现定时操作C#中,定时器,或者叫作间隔器,每隔一段时间执行一个操作。1.Timer本身就是多线程C#中为不同场合下使用定时器,提供了不同的Timer类,在asp.net中......
  • 直播软件搭建,uniapp 之使用 u-upload 组件来实现图片上传
    直播软件搭建,uniapp之使用u-upload组件来实现图片上传一、官方示例用法uview1.0u-upload官方文档 <template><view><u-uploadref="uUpload":action="action"......
  • vue中的get方法\post方法如何实现传递数组参数
    问题:后端接口参数里面带有数组,但是前端按常规方式提交后后台收不到数组数据解决方法:将数据用qs处理过后再提交请求封装:exportclassAxiosHttpService{$http:Ax......
  • ElasticSearch 实现分词全文检索 - filter查询
    目录ElasticSearch实现分词全文检索-概述ElasticSearch实现分词全文检索-ES、Kibana、IK安装ElasticSearch实现分词全文检索-Restful基本操作ElasticSearch......
  • 直播网站程序源码,采用Redis实现购物车功能
    直播网站程序源码,采用Redis实现购物车功能1.添加pom依赖  <!--redis--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-st......
  • 利用内置模块sched实现定时任务
    sched模块实现了一个通用事件调度器,在调度器类使用一个延迟函数等待特定的时间,执行任务。同时支持多线程应用程序,在每个任务执行后会立刻调用延时函数,以确保其他线程也能执......
  • UDP聊天实现
    1publicclassA{2publicstaticvoidmain(String[]args)throwsIOException{3DatagramSocketsocket=newDatagramSocket(8888);4......
  • 实现一个撸代码版chatgpt聊天窗
    最近在学习chatgpt和react,想做个东西练练手。刚好看到vscode上面有个chatgpt插件,可以在聊天对话框中输出markdown格式的代码块,哎呦不错哦,就它了。由于时间有限直接去githu......
  • uni-app 实现轮播图组件外轮廓背景色随图片主题色改变
    uni-app实现轮播图组件外轮廓背景色随图片主题色改变<template><viewclass="container"><canvascanvas-id="getThemeColorCanvas"id="getThemeCo......
  • 利用定位+margin:auto实现元素水平居中
    box1(父级)设置相对定位,box2(子级)绝对定位,并且四个属性值都为0,虽然box2设置了宽高,但实际上box2的虚拟占位已经撑满了个整个box1,这个时候给它一个margin:auto它就可以上下左右居......