SSU- 397 Text Editor
簡單模擬題 連結串列還是用的不清楚
#include<stdio.h>
#include<iostream>
#include<string>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
const int maxn = 1000005;
int pos,now;
struct Node
{
char ch;
int pre,next;
}node[maxn];
int main()
{
//freopen("data.txt","r",stdin);
char ch;
now = 0,pos = 0;
node[0].ch = ' '; node[0].pre = -1; node[0].next = -1;
while( 1 ){
ch = getchar();
if( ch == 'L' ){
if( node[now].pre != -1 )
now = node[now].pre;
}
else if( ch == 'R' ){
if( node[now].next != -1 )
now = node[now].next;
}
else if( ch >= 'a' && ch <= 'z' ){
node[++pos].ch = ch;
if( node[now].next != -1 )
node[node[now].next].pre = pos;
node[pos].next = node[now].next; node[now].next = pos;
node[pos].pre = now;
now = pos;
}
else
break;
}
now = node[0].next;
while(now != -1 ){
printf("%c",node[now].ch);
now = node[now].next;
}
puts("");
return 0;
}
相關文章
- 菜鳥破解錄(18)之 GWD Text Editor 3.0 (4千字)
- 菜鳥破解實錄 之 GWD Text Editor 3.0 (9千字)
- ZROJ#397. 【18提高7】模仿遊戲(爆搜)遊戲
- javascript editorJavaScript
- wysiwyg editor
- vi editor
- Oracle 11G OCP 1Z0-053 397Oracle
- visual Editor
- Fixed "There was a problem with the editor 'vi'"
- UE.getEditor('editor')
- 探究 Text Kit 和 Core Text 的前世今生 (Text Kit 篇)
- 010 Editor Mac版最新 +010 Editor 註冊碼Mac
- Ace editor中文文件
- html js editor on lineHTMLJS
- Oracle BBED(block browse and editor)OracleBloC
- swagger editor使用Swagger
- text/html和text/plain的區別HTMLAI
- jQuery text()jQuery
- jQuery :textjQuery
- Text Representation
- Editor.md 使用小結
- JSON Editor 中文文件JSON
- mysql_config_editorMySql
- vmplayer 安裝network editor
- CSS 文字裝飾 text-decoration & text-emphasisCSS
- ORACLE TEXT(轉)Oracle
- SAP MM Table to read PO Header text and item textHeader
- mysql_config_editor元件MySql元件
- 有關Editor的記錄(一)
- 筆記:editor.md 常用 api筆記API
- M$的DHTML Editor 使用心得HTML
- Oracle Text簡介Oracle
- CSS text-strokeCSS
- CSS text-overflowCSS
- Sublime Text全程指南
- mysql_config_editor 配置工具MySql
- SUPTOOL: BBED - 7.3.2+ Database Block Editor(轉)DatabaseBloC
- GitHub 釋出了 web editor,聊聊個人看法GithubWeb