Submission #345250


Source Code Expand

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <utility>
using namespace std;

int main(){
	string s, t="";
	int a=0;
	
	cin >> s;
	while(a<s.size()){
		char p=s[a];
		int b=0;
		while(a+b<s.size() && s[a+b]==s[a]) b++;
		t+=p;
		t+=to_string(b);
		a+=b;
		//printf("%d\n", a);
	}
	
	cout << t << endl;
}

Submission Info

Submission Time
Task B - 高橋くんと文字列圧縮
User imulan
Language C++ (G++ 4.6.4)
Score 0
Code Size 386 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:19:17: error: ‘to_string’ was not declared in this scope