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】模仿遊戲(爆搜)遊戲
- Oracle 11G OCP 1Z0-053 397Oracle
- javascript editorJavaScript
- wysiwyg editor
- vi editor
- visual Editor
- Fixed "There was a problem with the editor 'vi'"
- UE.getEditor('editor')
- react markdown editor示例React
- omi ace markdown editor
- stencil ace markdown editor
- 探究 Text Kit 和 Core Text 的前世今生 (Text Kit 篇)
- 010 Editor Mac版最新 +010 Editor 註冊碼Mac
- text/html和text/plain的區別HTMLAI
- Ace editor中文文件
- html js editor on lineHTMLJS
- Oracle BBED(block browse and editor)OracleBloC
- swagger editor使用Swagger
- v-md-editor示例
- react-markdown-editor示例React
- vue3-excel-editorVueExcel
- jQuery text()jQuery
- jQuery :textjQuery
- Text Representation
- Editor.md 使用小結
- JSON Editor 中文文件JSON
- mysql_config_editorMySql
- vmplayer 安裝network editor
- react-md-editor使用示例React
- monaco-editor 的 Language Services
- CSS 文字裝飾 text-decoration & text-emphasisCSS
- ORACLE TEXT(轉)Oracle
- text-to-motion
- text1
- SAP MM Table to read PO Header text and item textHeader
- mysql_config_editor元件MySql元件