CSES - Datatähti 2017 alku - Results
Submission details
Task:Pakkaus
Sender:VOL
Submission time:2016-10-04 17:56:52 +0300
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp:1:20: fatal error: stdafx.h: No such file or directory
 #include "stdafx.h"
                    ^
compilation terminated.

Code

#include "stdafx.h"
#include <string>
#include <iostream>
#include <vector>
using namespace std;
int numeroidenMaara(int i) {
int numerot = 0;
while (i) {
i /= 10;
numerot++;
}
return numerot;
}
void main() {
string merkkijono;
vector<int> numeroIndeksit;
vector<int> maarat;
cin >> merkkijono;
string tulos = "";
while (merkkijono.length() > 0) {
int maara = atoi(merkkijono.c_str());
int numerot = numeroidenMaara(maara);
merkkijono.erase(0, numerot);
string merkit;
for (int i = 0; i < merkkijono.length(); i++) {
if (!isdigit(merkkijono.at(i))) {
merkit += merkkijono.at(i);
}
else {
break;
}
}
merkkijono.erase(0, merkit.length());
for (int i = 0; i < maara; i++) {
tulos.append(merkit);
}
}
cout << tulos;
system("pause");
}