编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#1846 #993. 汉诺塔问题 Compile Error 0 0 ms 0 K C / 201 B LSH1015 2023-10-15 16:56:44
显示原始代码
#include <stdio.h>
long long int main() {
    long long int n, i;
    scanf("%lld", &n);
    t = 2;
    for (i = 0; i < n; i++) {
        t = t * 2;
    }
    t = t - 1 printf("%lld", n);
    return 0;
}

编译信息

/sandbox/1/a.c:2:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
long long int main(){
^
/sandbox/1/a.c:2:1: note: change return type to 'int'
long long int main(){
^~~~~~~~~~~~~
int
/sandbox/1/a.c:5:5: error: use of undeclared identifier 't'
    t=2;
    ^
/sandbox/1/a.c:8:9: error: use of undeclared identifier 't'
        t=t*2;
        ^
/sandbox/1/a.c:8:11: error: use of undeclared identifier 't'
        t=t*2;
          ^
/sandbox/1/a.c:10:5: error: use of undeclared identifier 't'
    t=t-1
    ^
/sandbox/1/a.c:10:7: error: use of undeclared identifier 't'
    t=t-1
      ^
1 warning and 5 errors generated.