Submission #2499396


Source Code Expand

Copy
999

#include <stdio.h>
int x;
int myexp(int b, int p){
    int ans = 1;
    for(int i = 0; i < p; i++) ans *= b;
    return ans;
}
int main(void){
    // Your code here!
    scanf("%d",&x);
    if(x == 1){ puts("1"); return 0;}
    
    int max = 0;
    for(int b = 2; b < x; b++){
        for(int p = 2; myexp(b,p) <= x; p++){
            if(max < myexp(b,p)) max = myexp(b,p);
        }
    }
    printf("%d",max);
}

Submission Info

Submission Time
Task B - Exponential
User weizen
Language C++14 (GCC 5.4.1)
Score 0
Code Size 442 Byte
Status CE

Compile Error

./Main.cpp:1:1: error: expected unqualified-id before numeric constant
 999
 ^