Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
129808 罗迎甲 青蛙跳台阶 C++ Compile Error 0 MS 0 KB 312 2025-09-06 16:06:11

Tests(0/0):


Code:

#include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ long long a[51] = {0, 1, 2, 4}; // 初始化前4项(索引0~3) int n; long long q = 0; cin >> n; for(int a=1;a<=n; cout <<(a-1)*2; } return 0;


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:19: error: expected ')' before ';' token
     cout <<(a-1)*2;
                   ^
Main.cc:7:15: warning: unused variable 'a' [-Wunused-variable]
     long long a[51] = {0, 1, 2, 4}; // 初始化前4项(索引0~3)
               ^
Main.cc:9:15: warning: unused variable 'q' [-Wunused-variable]
     long long q = 0;
               ^
Main.cc: At global scope:
Main.cc:17:5: error: expected unqualified-id before 'return'
     return 0;
     ^