Language: C++

// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
r#"10"# => r#"9"#,
r#"1"# => r#"1"#,
}


fn solve(src: &str) -> String {
    input! {
        source = src,
        x: usize,
    }

    let mut ans = 1usize.pow(2);

    'outer: for i in (1..x + 1).rev() {
        // println!("-----[{}]--------", i);
        for b in 1..x + 1 {
            for p in 2..x + 1 {
                let n = b.pow(p as u32);
                // println!("n({}), p({}) = {}", b, p, n);
                if n == i {
                    // println!("{}", i);
                    ans = i;
                    break 'outer;
                }

                if n > x {
                    // println!("--");
                    break;
                }
            }
        }
    }

    ans.to_string()
}

Compiler output:
a.cc:4:2: error: invalid preprocessing directive #[
    4 | #[allow(unused_macros)]
      |  ^
a.cc:12:2: error: invalid preprocessing directive #[
   12 | #[allow(unused_macros)]
      |  ^
a.cc:28:2: error: invalid preprocessing directive #[
   28 | #[allow(unused_macros)]
      |  ^
a.cc:35:10: error: too many decimal points in number
   35 |         (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
      |          ^~~~~~~
a.cc:41:14: error: too many decimal points in number
   41 |             (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
      |              ^~~~~~
a.cc:68:10: error: invalid preprocessing directive #[
   68 |         #[test]
      |          ^
a.cc:78:2: error: stray '#' in program
   78 | r#"10"# => r#"9"#,
      |  ^
a.cc:78:7: error: stray '#' in program
   78 | r#"10"# => r#"9"#,
      |       ^
a.cc:78:13: error: stray '#' in program
   78 | r#"10"# => r#"9"#,
      |             ^
a.cc:78:17: error: stray '#' in program
   78 | r#"10"# => r#"9"#,
      |                 ^
a.cc:79:2: error: stray '#' in program
   79 | r#"1"# => r#"1"#,
      |  ^
a.cc:79:6: error: stray '#' in program
   79 | r#"1"# => r#"1"#,
      |      ^
a.cc:79:12: error: stray '#' in program
   79 | r#"1"# => r#"1"#,
      |            ^
a.cc:79:16: error: stray '#' in program
   79 | r#"1"# => r#"1"#,
      |                ^
a.cc:91:5: warning: missing terminating ' character
   91 |     'outer: for i in (1..x + 1).rev() {
      |     ^
a.cc:91:5: error: missing terminating ' character
   91 |     'outer: for i in (1..x + 1).rev() {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:93:18: error: too many decimal points in number
   93 |         for b in 1..x + 1 {
      |                  ^~~~
a.cc:94:22: error: too many decimal points in number
   94 |             for p in 2..x + 1 {
      |                      ^~~~
a.cc:100:27: warning: missing terminating ' character
  100 |                     break 'outer;
      |                           ^
a.cc:100:27: error: missing terminating ' character
  100 |                     break 'outer;
      |                           ^~~~~~~
a.cc:5:1: error: 'macro_rules' does not name a type
    5 | macro_rules! input {
      | ^~~~~~~~~~~
a.cc:13:1: error: 'macro_rules' does not name a type
   13 | macro_rules! input_inner {
      | ^~~~~~~~~~~
a.cc:29:1: error: 'macro_rules' does not name a type
   29 | macro_rules! read_value {
      | ^~~~~~~~~~~
a.cc:58:1: error: 'fn' does not name a type
   58 | fn main() {
      | ^~
a.cc:66:1: error: 'macro_rules' does not name a type
   66 | macro_rules! test {
      | ^~~~~~~~~~~
a.cc:77:1: error: 'test' does not name a type
   77 | test! {
      | ^~~~
a.cc:83:1: error: 'fn' does not name a type
   83 | fn solve(src: &str) -> String {
      | ^~
a.cc:111:5: error: 'ans' does not name a type
  111 |     ans.to_string()
      |     ^~~
a.cc:112:1: error: expected declaration before '}' token
  112 | }
      | ^