diff options
author | crupest <crupest@outlook.com> | 2021-03-24 16:42:17 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-03-24 16:42:17 +0800 |
commit | 592edbe3584d88b92367b4a661f4c4082b3f382c (patch) | |
tree | 255e1500a0aa46b95a392b51ddaa189b2c519d90 /acwing | |
parent | f6ac881125639d68036d3e158609f56a504dede6 (diff) | |
download | solutions-592edbe3584d88b92367b4a661f4c4082b3f382c.tar.gz solutions-592edbe3584d88b92367b4a661f4c4082b3f382c.tar.bz2 solutions-592edbe3584d88b92367b4a661f4c4082b3f382c.zip |
Add acwing 2066.
Diffstat (limited to 'acwing')
-rw-r--r-- | acwing/2066.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/acwing/2066.cpp b/acwing/2066.cpp new file mode 100644 index 0000000..7a6132b --- /dev/null +++ b/acwing/2066.cpp @@ -0,0 +1,21 @@ +#include <cctype>
+#include <iostream>
+
+int main() {
+ std::string input;
+ std::cin >> input;
+ std::string result;
+
+ for (int i = 0; i < input.size(); i++) {
+ if (std::isalpha(input[i])) {
+ result.push_back(input[i]);
+ } else {
+ int c = input[i] - '1';
+ result.append(c, input[i - 1]);
+ }
+ }
+
+ std::cout << result;
+
+ return 0;
+}
|