6 solutions

  • 0
    @ 2026-9-13 11:50:59

    他们的都不行好吧 #include<bits/stdc++.h> using namespace std; char a[24],b[24]; int rear=0,front=0; void push(char x) { if(rear<24) { a[rear]=x; rear++; } } void pop() { if(front!=rear) { front++; } } char getFront() { return a[front]; } int size() { return rear-front; } int main() { cin>>b; for(int i=0;i<strlen(b);i++) { push(b[i]); } int k=1; while(size()!=0) { if(k%2!=0) { cout<<getFront(); pop(); } else { push(getFront()); pop(); push(getFront()); pop(); } k++; } return 0; }

    Information

    ID
    2321
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    # Submissions
    19
    Accepted
    9
    Uploaded By