Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
146786 任艺宸 x的n次方 C++ Compile Error 0 MS 0 KB 388 2026-01-30 18:52:01

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int a(x,n) { if(n==0)return 1; return a(x,n-1)*x; } int main(){ int x,n; cin>>x>>n; cout<<a(x,n)<<endl; return 0; }


Run Info:

Main.cc:7:7: error: 'x' was not declared in this scope
 int a(x,n)
       ^
Main.cc:7:9: error: 'n' was not declared in this scope
 int a(x,n)
         ^
Main.cc:7:10: error: expression list treated as compound expression in initializer [-fpermissive]
 int a(x,n)
          ^
Main.cc:8:1: error: expected ',' or ';' before '{' token
 {
 ^
Main.cc: In function 'int main()':
Main.cc:15:16: error: 'a' cannot be used as a function
     cout<