Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void) {
	const char *SEP = " ";
	int n;
	char input_str[256];
	char *num_str;
	int i;

	int seven1[] = {7};
	int seven2[] = {11, 77};
	int seven3[] = {3, 21, 37, 111, 259, 777};
	int seven4[] = {101, 707, 1111, 7777};
	int seven5[] = {41, 271, 287, 1897, 11111, 77777};
	int seven6[] = {13, 33, 39, 49, 91, 143, 147, 231, 273, 407, 429, 481, 539, 637, 1001, 1221, 1443, 1617, 1813, 1911, 2849, 3003, 3367, 5291, 5439, 7007, 8547, 10101, 15873, 19943, 21021, 23569, 37037, 59829, 70707, 111111, 259259, 777777};
	int seven7[] = {239, 1673, 4649, 32543, 1111111, 7777777};
	int seven8[] = {73, 137, 511, 803, 959, 1507, 5621, 7373, 10001, 10549, 13837, 51611, 70007, 81103, 96859, 110011, 152207, 567721, 770077, 1010101, 1065449, 7070707, 11111111, 77777777};
	int seven9[] = {9, 63, 333, 2331, 333667, 1001001, 2335669, 3003003, 7007007, 12345679, 21021021, 37037037, 86419753, 111111111, 259259259, 777777777};
	int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};

	fgets(input_str, sizeof(input_str), stdin);
	num_str = strtok(input_str, SEP);
	n = atoi(num_str);

	for ( i = 0; i < (sizeof(seven1)/sizeof(int)); i++ ){
		if (seven1[i] == n) {
			printf("1\n");
			return 0;
		}
	}

	for ( i = 0; i < (sizeof(seven2)/sizeof(int)); i++ ){
		if (seven2[i] == n) {
			printf("2\n");
			return 0;
		}
	}

	for ( i = 0; i < (sizeof(seven3)/sizeof(int)); i++ ){
		if (seven3[i] == n) {
			printf("3\n");
			return 0;
		}
	}

	for ( i = 0; i < (sizeof(seven4)/sizeof(int)); i++ ){
		if (seven4[i] == n) {
			printf("4\n");
			return 0;
		}
	}

	for ( i = 0; i < (sizeof(seven5)/sizeof(int)); i++ ){
		if (seven5[i] == n) {
			printf("5\n");
			return 0;
		}
	}

	for ( i = 0; i < (sizeof(seven6)/sizeof(int)); i++ ){
		if (seven6[i] == n) {
			printf("6\n");
			return 0;
		}
	}

	for ( i = 0; i < (sizeof(seven7)/sizeof(int)); i++ ){
		if (seven7[i] == n) {
			printf("7\n");
			return 0;
		}
	}

	for ( i = 0; i < (sizeof(seven8)/sizeof(int)); i++ ){
		if (seven8[i] == n) {
			printf("8\n");
			return 0;
		}
	}

	for ( i = 0; i < (sizeof(seven9)/sizeof(int)); i++ ){
		if (seven9[i] == n) {
			printf("9\n");
			return 0;
		}
	}

	for ( i = 0; i < (sizeof(seven10)/sizeof(int)); i++ ){
		if (seven10[i] == n) {
			printf("10\n");
			return 0;
		}
	}

	printf("-1\n");
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:21:9: warning: braces around scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |         ^~~
main.c:21:9: note: (near initialization for 'seven10[0]')
main.c:21:32: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                ^~~~
main.c:21:32: note: (near initialization for 'seven10[0]')
main.c:21:38: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                      ^~~~
main.c:21:38: note: (near initialization for 'seven10[0]')
main.c:21:44: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                            ^~~~
main.c:21:44: note: (near initialization for 'seven10[0]')
main.c:21:50: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                  ^~~~~
main.c:21:50: note: (near initialization for 'seven10[0]')
main.c:21:57: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                         ^~~~~
main.c:21:57: note: (near initialization for 'seven10[0]')
main.c:21:64: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                ^~~~~~
main.c:21:64: note: (near initialization for 'seven10[0]')
main.c:21:72: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                        ^~~~~~
main.c:21:72: note: (near initialization for 'seven10[0]')
main.c:21:80: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                ^~~~~~
main.c:21:80: note: (near initialization for 'seven10[0]')
main.c:21:88: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                        ^~~~~~
main.c:21:88: note: (near initialization for 'seven10[0]')
main.c:21:96: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                ^~~~~~
main.c:21:96: note: (near initialization for 'seven10[0]')
main.c:21:104: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                        ^~~~~~~
main.c:21:104: note: (near initialization for 'seven10[0]')
main.c:21:113: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                                 ^~~~~~~
main.c:21:113: note: (near initialization for 'seven10[0]')
main.c:21:122: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                                          ^~~~~~~
main.c:21:122: note: (near initialization for 'seven10[0]')
main.c:21:131: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                                                   ^~~~~~~~
main.c:21:131: note: (near initialization for 'seven10[0]')
main.c:21:141: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                                                             ^~~~~~~~
main.c:21:141: note: (near initialization for 'seven10[0]')
main.c:21:151: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                                                                       ^~~~~~~~
main.c:21:151: note: (near initialization for 'seven10[0]')
main.c:21:161: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                                                                                 ^~~~~~~~~
main.c:21:161: note: (near initialization for 'seven10[0]')
main.c:21:172: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                                                                                            ^~~~~~~~~
main.c:21:172: note: (near initialization for 'seven10[0]')
main.c:21:183: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                                                                                                       ^~~~~~~~~
main.c:21:183: note: (near initialization for 'seven10[0]')
main.c:21:194: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                                                                                                                  ^~~~~~~~~~
main.c:21:194: note: (near initialization for 'seven10[0]')
main.c:21:206: warning: excess elements in scalar initializer
   21 |         int seven10[] = {{451, 2981, 3157, 9091, 20867, 63637, 100001, 122221, 372731, 700007, 855547, 2463661, 2609117, 4100041, 17245627, 27100271, 28700287, 101010101, 189701897, 707070707, 1111111111, 7777777777};
      |                                                                                                                                                                                                              ^~~~~~~~~~
main.c:21:206: