Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
119311 张天翔 行编辑程序 C++ 通过 100 0 MS 240 KB 548 2024-01-05 13:50:13

Tests(14/14):


#include<bits/stdc++.h> using namespace std; int head=0,head1=0; char a[256]; char ch; void push(){ a[head++]=ch; } void pop1(){ head--; } void pop2(){ head=0; } bool empty(){ return head==0; } int main(){ //freopen("editor.in","r",stdin); //freopen("editor.out","w",stdout); while(cin>>ch){ if(ch!='#'&&ch!='@'){ push(); } else if(ch=='#'){ if(!empty()){ pop1(); } } else if(ch=='@'){ if(!empty()){ pop2(); } } } while(!empty()){ cout<<a[head1++]; head--; } }


测评信息: