WA 0分求助
查看原帖
WA 0分求助
723466
banned_gutongxing楼主2022/5/14 22:55
#include <cstring>
#include <string>
#include <cctype>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <deque>
#include <vector>
using namespace std;
#define endl "\n"
int main(){
    char a[100]={};
    gets(a);
    int len = strlen(a) - 1;
    if(a[len] != '4'){
    	a[len] = '4';
    	cout << a << endl;
	}
	len--;
    while(len!=0){
    	swap(a[len+1],a[len]);
    	a[len+1] = '\0';
    	cout << a << endl;
    	len--;
	}
	return 0;
}
2022/5/14 22:55
加载中...