解密QQ
2023-11-05 10:16:39
发布于:广东
#include<iostream>
#include<cstring>
using namespace std;
int head=0,tail=0;
char q[101],s[101];
void push(char t){
tail++;
q[tail]=t;
}
char front(){
return q[head+1];
}
void pop(){
head++;
}
int size(){
return tail-head;
}
bool empty(){
return tail==head;
}
int main(){
cin>>s;
for(int i=0;i<strlen(s);i++)
push(s[i]);
while(!empty()){
cout<<front();
pop();
push(front());
pop();
}
return 0;
}
这里空空如也
有帮助,赞一个