Borderou de evaluare (job #2195165)
Utilizator | Data | 15 aprilie 2018 15:06:46 | |
---|---|---|---|
Problema | Texttrim | Status | done |
Runda | Arhiva Monthly | Compilator | cpp | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
user.cpp: In function ‘int main()’:
user.cpp:15:2: warning: ‘char* gets(char*)’ is deprecated [-Wdeprecated-declarations]
gets(a);
^~~~
In file included from /usr/include/c++/6/cstdio:42:0,
from user.cpp:1:
/usr/include/stdio.h:638:14: note: declared here
extern char *gets (char *__s) __wur __attribute_deprecated__;
^~~~
user.cpp:15:8: warning: ‘char* gets(char*)’ is deprecated [-Wdeprecated-declarations]
gets(a);
^
In file included from /usr/include/c++/6/cstdio:42:0,
from user.cpp:1:
/usr/include/stdio.h:638:14: note: declared here
extern char *gets (char *__s) __wur __attribute_deprecated__;
^~~~
user.cpp:20:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for( int i = 0; i < strlen(a) && sum <= w; sum += l[a[i]], i++ );
~~^~~~~~~~~~~
user.cpp:20:58: warning: array subscript has type ‘char’ [-Wchar-subscripts]
for( int i = 0; i < strlen(a) && sum <= w; sum += l[a[i]], i++ );
^
user.cpp:23:3: error: ‘g’ was not declared in this scope
g << a;
^
user.cpp:26:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for( int sum = 0, i = 0; i < strlen(a) ; i++ )
~~^~~~~~~~~~~
user.cpp:28:19: warning: array subscript has type ‘char’ [-Wchar-subscripts]
if( sum + l[a[i]] <= w - 3 )
^
user.cpp:31:17: warning: array subscript has type ‘char’ [-Wchar-subscripts]
sum += l[a[i]];
^
user.cpp:17:6: warning: unused variable ‘i’ [-Wunused-variable]
int i = -1;
^
user.cpp:18:6: warning: unused variable ‘s’ [-Wunused-variable]
int s = 0;
^
user.cpp:11:35: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
freopen ("texttrim.in","r",stdin);
^
user.cpp:12:37: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
freopen ("texttrim.out","w",stdout);
^
user.cpp:13:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&l[' ']);
^
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !