Compile Error

/in/foo.cc:4:7: error: expected nested-name-specifier before 'namespacce'
 using namespacce std;
       ^~~~~~~~~~
/in/foo.cc:6:1: error: expected initializer before 'long'
 long long int n,s,a[1000009],cs[1000009];
 ^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:9:2: error: 'cin' was not declared in this scope
  cin>>n;
  ^~~
/in/foo.cc:9:2: note: suggested alternative:
In file included from /in/foo.cc:1:0:
/usr/include/c++/6/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^~~
/in/foo.cc:9:7: error: 'n' was not declared in this scope
  cin>>n;
       ^
/in/foo.cc:12:15: error: 'a' was not declared in this scope
   scanf("%d",&a[i]);
               ^
/in/foo.cc:13:3: error: 's' was not declared in this scope
   s+=a[i];
   ^
/in/foo.cc:15:2: error: 's' was not declared in this scope
  s/=n;
  ^
/in/foo.cc:17:3: error: 'cs' was not declared in this scope
   cs[i]=cs[i-1]+s-a[i-1];
   ^~
/in/foo.cc:17:19: error: 'a' was not declared in this scope
   cs[i]=cs[i-1]+s-a[i-1];
                   ^
/in/foo.cc:18:7: error: 'cs' was not declared in this scope
  sort(cs+1,cs+n+1);
       ^~
/in/foo.cc:18:18: error: 'sort' was not declared in this scope
  sort(cs+1,cs+n+1);
                  ^
/in/foo.cc:19:2: error: 'mid' was not declared in this scope
  mid=cs[(n+1)/2];
  ^~~
/in/foo.cc:21:3: error: 'ans' was not declared in this scope
   ans+=abs(cs[i]-mid);
   ^~~
/in/foo.cc:22:2: error: 'cout' was not declared in this scope
  cout<<ans;
  ^~~~
/in/foo.cc:22:2: note: suggested alternative:
In file included from /in/foo.cc:1:0:
/usr/include/c++/6/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
/in/foo.cc:22:8: error: 'ans' was not declared in this scope
  cout<<ans;
        ^~~

信息

递交者
类型
递交
题目
「一本通 1.1 练习 6」糖果传递
语言
C++
递交时间
2021-01-09 20:47:16
评测时间
2021-01-09 20:47:16
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes