没有听取WA声一片但……troll:)
查看原帖
没有听取WA声一片但……troll:)
1165586
lizishi楼主2024/7/11 23:41
#include <bits/stdc++.h>
using namespace std;
int a[20];
double get(double n) {
    while (n >= 10) {
        n /= 10;
    }
    return n;
}

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < n; i++) {
	    for (int j = i; j > 0; j--) {
	        if (get(a[j]) > get(a[j - 1])) {
	            int temp = a[j - 1];
	            a[j - 1] = a[j];
	            a[j] = temp;
	        }
	    }
	}
	for (int i = 0; i < n; i++) {
		cout << a[i];
	}
	return 0;
}
用了toolhelper,样例输入#1通过。
我没用到字符串。
测评时,仅最后4个测试点有分。
测试点#1和#29出错,其他全对。
成绩:75 求助玄关。QwQ lol:(troll:)() 
2024/7/11 23:41
加载中...