CSES - Datatähti 2024 alku - Results
Submission details
Task:Monistus
Sender:onokk
Submission time:2023-10-30 15:39:38 +0200
Language:C++ (C++11)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:10:29: error: 'sing' was not declared in this scope
   10 |         for (int i = 0; i < sing(input.length()); i++)
      |                             ^~~~

Code

#include <iostream>
using namespace std;
int main()
{
string input;
cin >> input;
while (input.find_first_of("1234567890") != string::npos)
{
for (int i = 0; i < sing(input.length()); i++)
{
if (input[i] >= '0' and input[i] <= '9')
{
char c = input[i];
input.erase(i, 1);
input.insert(i, input, i, c - '0');
}
}
}
cout << input << endl;
}