Submission #592202


Source Code Expand

Copy
#include <iostream>
#include <string>

using namespace std;

bool kansuu(int k);

int main(){
	int n;

	cin >> n;

	int i = 1;

	int cnt = 0;

	while (true)
	{
		if (kansuu(i)) cnt++;

		if (cnt == n) break;

		i++;


	}

	cout << i << endl;

}


bool kansuu(int k){  //kはゾロ目数か
	string str;

	str = to_string(k);

	char a = str[0];

	for (int i = 0; i < str.size(); i++){
		if (a != str[i]) return false;
	}


	return true;

}


Submission Info

Submission Time
Task A - ゾロ目数
User nhoopQstw3E
Language C++ (GCC 4.9.2)
Score 0
Code Size 490 Byte
Status

Compile Error

./Main.cpp: In function ‘bool kansuu(int)’:
./Main.cpp:36:19: error: ‘to_string’ was not declared in this scope
  str = to_string(k);
                   ^