Submission #575401


Source Code Expand

#include <iostream>
using namespece std;

int main(){
const int L,H,N;
cin >>L>>H;
cin >>N;
int a[N];

for (int i = 0,i<N;i++){
cin >> a[i];
}

for (int n=0;n<N;n++){
if (a[n]>H){
cout <<"-1"<<endl;
}//ifend

else if (a[i]<L){
cout <<L-a[i]<<endl;
}

else{
cout <<"0"<<endl;
}


}//forend


return 0;
}

Submission Info

Submission Time
Task B - 運動管理
User uynet
Language C++ (GCC 4.9.2)
Score 0
Code Size 333 Byte
Status CE

Compile Error

./Main.cpp:2:7: error: expected nested-name-specifier before ‘namespece’
 using namespece std;
       ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:5:11: error: uninitialized const ‘L’ [-fpermissive]
 const int L,H,N;
           ^
./Main.cpp:5:13: error: uninitialized const ‘H’ [-fpermissive]
 const int L,H,N;
             ^
./Main.cpp:5:15: error: uninitialized const ‘N’ [-fpermissive]
 const int L,H,N;
               ^
./Main.cpp:6:1: error: ‘cin’ was not declared in this scope
 cin >>L>>H;
 ^
./Main.cpp:6:1: note: suggested alternative:
In file included from ./Main.cpp:1:0:
/usr/include/c++/4.9/iostream:60:18: note:   ‘std::cin’
   extern istream cin;  /// Linked to standard input
                  ^
./Main.cpp:10:17: error: expected initializer before ‘<’ token
 for (int i = 0,i<N;i++){
                 ^
./Main.cpp:10:17: error: expected ‘;’ before ‘<’ token
./Main.cpp:10:17: error: expected primary-expression before ‘<’ token
./Main.cpp:16:1: error:...