c/c++课的作业合集,都是很简单的文件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
726 B

#include <cstring>
#include "iostream"
#include "neoString/CString.h"
using namespace std;
int main() {
// strcpy(p, "ac");
// cout << p << endl;
int n, i, j;
while (cin >> n) {
CString *c = new CString[n + 2];
for (i = 0; i < n; i++) {
cin >> c[i];
}
for (i = 0; i < n - 1; i++) {
for (j = 0; j < n - i - 1; j++) {
if (c[j] > c[j + 1]) {
c[n] = c[j];
c[j] = c[j + 1];
c[j + 1] = c[n];
}
}
}
for (i = 0; i < n; i++) {
c[n + 1] += c[i];
}
cout << c[n + 1] << endl;
delete[] c;
}
return 0;
}