文章

10

粉丝

0

获赞

12

访问

551

头像
字符移动 题解:C++
P1012 贵州大学机试题
发布于2026年1月23日 14:08
阅读数 67

#include<stdio.h>
#include <iostream>
#include<math.h>
#include <stdlib.h>
#include <string>
#include<cctype>
#include<algorithm>
using namespace std;

int main ()
{    
    string str,num;
    getline(cin,str);
    for( int i=0;i<str.size();)
    {
        if(str[i]>='0'&&str[i]<='9')
        {
            num+=str[i];
            str.erase(i,1);
        }
        else {i++;}
    }
    str=str+num;
    cout<<str<<endl;
    system("pause");
    return 0;
}

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发