View Code of Problem 31

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
using namespace std;
int main()
{
	int a[] = { 23,128,233,338,443,548,653,758,863,968,1073,1178,1283,1388,1493,1598,1703,
				1808,1913,2018,2123,2228,2333,2438,2543,2648,2753,2858,2963,3068,3173,3278,
				3383,3488,3593,3698,3803,3908,4013,4118,4223,4328,4433,4538,4643,4748,4853,
				4958,5063,5168,5273,5378,5483,5588,5693,5798,5903,6008,6113,6218,6323,6428,6533,
				6638,6743,6848,6953,7058,7163,7268,7373,7478,7583,7688,7793,7898,8003,8108,8213,
				8318,8423,8528,8633,8738,8843,8948,9053,9158,9263,9368,9473,9578,9683,9788,9893,9998 };
	int k;
	while(cin>>k){
		cout << a[k-1] << endl;

	}
	

}

Double click to view unformatted code.


Back to problem 31