Precreation contest files
This commit is contained in:
22
misc/chuyen-de-xau/b8.cpp
Normal file
22
misc/chuyen-de-xau/b8.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
string words[20];
|
||||
|
||||
bool checker(const string &a, const string &b) { return a.size() < b.size(); }
|
||||
|
||||
int main() {
|
||||
ios_base::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
freopen("b8.inp", "r", stdin);
|
||||
|
||||
int n = 0;
|
||||
while (cin >> words[n] && n < 20)
|
||||
n++;
|
||||
|
||||
stable_sort(words, words + n, checker);
|
||||
for (int i = 0; i < n; i++) {
|
||||
cout << words[i] << " ";
|
||||
}
|
||||
cout << '\n';
|
||||
}
|
||||
Reference in New Issue
Block a user