Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  #include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>

// ===============================================================

using namespace std;
using ll = long long;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;
using ld = long double;

// ========================================================================

//ライブラリ(*'▽')

ll gcd(ll a, ll b)
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}
//最大公約数
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
//最小公倍数
ll box(double a)
{
	ll b = a;
	return b;
}
//切り捨て
ll fff(double a)
{
	ll b = a + 0.5;
	return b;
}
//四捨五入
ll sum(ll n) {
	return (1 + n) * n / 2;
}
//1から整数nまでの合計を出す
bool prime(ll a)//素数判定、primeならtrue,違うならfalse
{
	if (a < 2) return false;
	else if (a == 2) return true;
	else if (a % 2 == 0) return false;
	double m = sqrt(a);
	for (int i = 3; i <= m; i += 2)
	{
		if (a % i == 0)
		{
			return false;
		}
	}

	// 素数である
	return true;
}
//素数判定
ll modpow(ll a, ll n, ll mod) {
	ll hi = 1;
	while (n > 0) {
		if (n & 1) hi = hi * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return hi;
}
//いろいろやります（ただの前座）
ll mg(ll a, ll mod) {
	return modpow(a, mod - 2, mod);
}
//割り算の10^9+7等対策で逆元を出します



// ========================================================================


vl e(250000);
vl f(250000, 100000000000);

int main() {
	long long int k;
	cin >> k;
	int x = 0;
	int ans = 0;
	for (int i = 1; i <= k; i++) {
		x = x * 10 + 7;
		x %= k;
		if (x == 0) {
			ans = i;
			break;
		}
	}
	if (ans == 0) {
		cout << -1 << endl;
	}
	else {
		cout << ans << endl;
	}


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:1: error: a function-definition is not allowed here before '{' token
   63 | {
      | ^
a.cc:75:1: error: a function-definition is not allowed here before '{' token
   75 | {
      | ^
a.cc:80:1: error: a function-definition is not allowed here before '{' token
   80 | {
      | ^
a.cc:86:1: error: a function-definition is not allowed here before '{' token
   86 | {
      | ^
a.cc:91:14: error: a function-definition is not allowed here before '{' token
   91 | ll sum(ll n) {
      |              ^
a.cc:96:1: error: a function-definition is not allowed here before '{' token
   96 | {
      | ^
a.cc:113:31: error: a function-definition is not allowed here before '{' token
  113 | ll modpow(ll a, ll n, ll mod) {
      |                               ^
a.cc:123:21: error: a function-definition is not allowed here before '{' token
  123 | ll mg(ll a, ll mod) {
      |                     ^
a.cc:136:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  136 | int main() {
      |         ^~
a.cc:136:9: note: remove parentheses to default-initialize a variable
  136 | int main() {
      |         ^~
      |         --
a.cc:136:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:136:12: error: a function-definition is not allowed here before '{' token
  136 | int main() {
      |            ^
a.cc:158:2: error: expected '}' at end of input
  158 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^