Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6961 谢锦卓 22数列变换III C++ Compile Error 0 MS 0 KB 463 2025-03-29 10:22:04

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[101],n,k,tot; double ave; int main(){ cin>>n; for{int i=1;i<=n;i++){ cin>>a[i]; } cin>>k; for(int i=tot;i<=n;i++){ if(a[i]==k)cnt++; } cout<<cnt; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:11:8: error: expected '(' before '{' token
     for{int i=1;i<=n;i++){
        ^
Main.cc:11:8: error: expected primary-expression before '{' token
Main.cc:11:8: error: expected ';' before '{' token
Main.cc:20:1: error: expected primary-expression at end of input
 }
 ^
Main.cc:20:1: error: expected ';' at end of input
Main.cc:20:1: error: expected primary-expression at end of input
Main.cc:20:1: error: expected ')' at end of input
Main.cc:20:1: error: expected statement at end of input
Main.cc:20:1: error: expected '}' at end of input