#793
SumProd
Se dau trei numere naturale a b c
. Să se determine cea mai mare valoare care se poate obține prin înmulțirea a două dintre numere și adunarea rezultatului cu al treilea.
Problema | SumProd | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54771705 | Utilizator | |
Fișier | sumprod.c | Dimensiune | 441 B |
Data încărcării | 08 Decembrie 2024, 12:24 | Scor / rezultat | Eroare de compilare |
sumprod.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token include <stdio.h> ^ In file included from sumprod.c:2:0: /usr/include/stdlib.h:139:1: error: unknown type name 'size_t' extern size_t __ctype_get_mb_cur_max (void) __THROW __wur; ^ /usr/include/stdlib.h:466:22: error: unknown type name 'size_t' extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur; ^ /usr/include/stdlib.h:468:22: error: unknown type name 'size_t' extern void *calloc (size_t __nmemb, size_t __size) ^ /usr/include/stdlib.h:468:38: error: unknown type name 'size_t' extern void *calloc (size_t __nmemb, size_t __size) ^ /usr/include/stdlib.h:480:36: error: unknown type name 'size_t' extern void *realloc (void *__ptr, size_t __size) ^ /usr/include/stdlib.h:756:9: error: unknown type name 'size_t' size_t __nmemb, size_t __size, __compar_fn_t __compar) ^ /usr/include/stdlib.h:756:25: error: unknown type name 'size_t' size_t __nmemb, size_t __size, __compar_fn_t __compar) ^ In file included from /usr/include/stdlib.h:760:0, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:20:49: error: unknown type name 'size_t' bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, ^ /usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:20:65: error: unknown type name 'size_t' bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, ^ In file included from sumprod.c:2:0: /usr/include/stdlib.h:765:34: error: unknown type name 'size_t' extern void qsort (void *__base, size_t __nmemb, size_t __size, ^ /usr/include/stdlib.h:765:50: error: unknown type name 'size_t' extern void qsort (void *__base, size_t __nmemb, size_t __size, ^ /usr/include/stdlib.h:863:36: error: unknown type name 'size_t' extern int mblen (const char *__s, size_t __n) __THROW; ^ /usr/include/stdlib.h:867:34: error: unknown type name 'size_t' const char *__restrict __s, size_t __n) __THROW; ^ /usr/include/stdlib.h:874:1: error: unknown type name 'size_t' extern size_t mbstowcs (wchar_t *__restrict __pwcs, ^ /usr/include/stdlib.h:875:32: error: unknown type name 'size_t' const char *__restrict __s, size_t __n) __THROW; ^ /usr/include/stdlib.h:877:1: error: unknown type name 'size_t' extern size_t wcstombs (char *__restrict __s, ^ /usr/include/stdlib.h:878:38: error: unknown type name 'size_t' const wchar_t *__restrict __pwcs, size_t __n) ^ In file included from /usr/include/stdlib.h:959:0, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib.h:25:9: error: unknown type name 'size_t' size_t __resolvedlen) __THROW __wur; ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdlib.h:24, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib.h:29:14: error: unknown type name 'size_t' extern char *__REDIRECT_NTH (__realpath_chk_warn, ^ In file included from /usr/include/stdlib.h:959:0, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib.h: In function 'realpath': /usr/include/i386-linux-gnu/bits/stdlib.h:39:30: error: 'size_t' undeclared (first use in this function) if (__bos (__resolved) != (size_t) -1) ^ /usr/include/i386-linux-gnu/bits/stdlib.h:39:30: note: each undeclared identifier is reported only once for each function it appears in /usr/include/i386-linux-gnu/bits/stdlib.h: At top level: /usr/include/i386-linux-gnu/bits/stdlib.h:52:52: error: unknown type name 'size_t' extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen, ^ /usr/include/i386-linux-gnu/bits/stdlib.h:53:8: error: unknown type name 'size_t' size_t __nreal) __THROW __nonnull ((2)); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdlib.h:24, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib.h:54:12: error: unknown type name 'size_t' extern int __REDIRECT_NTH (__ptsname_r_alias, (int __fd, char *__buf, ^ /usr/include/i386-linux-gnu/bits/stdlib.h:57:12: error: unknown type name 'size_t' extern int __REDIRECT_NTH (__ptsname_r_chk_warn, ^ /usr/include/i386-linux-gnu/bits/stdlib.h:57:12: error: unknown type name 'size_t' extern int __REDIRECT_NTH (__ptsname_r_chk_warn, ^ /usr/include/i386-linux-gnu/bits/stdlib.h:64:1: error: unknown type name 'size_t' __NTH (ptsname_r (int __fd, char *__buf, size_t __buflen)) ^ In file included from /usr/include/stdlib.h:959:0, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib.h:77:54: error: unknown type name 'size_t' extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen) ^ /usr/include/i386-linux-gnu/bits/stdlib.h: In function 'wctomb': /usr/include/i386-linux-gnu/bits/stdlib.h:92:23: error: 'size_t' undeclared (first use in this function) if (__bos (__s) != (size_t) -1 && __STDLIB_MB_LEN_MAX > __bos (__s)) ^ /usr/include/i386-linux-gnu/bits/stdlib.h: At top level: /usr/include/i386-linux-gnu/bits/stdlib.h:98:1: error: unknown type name 'size_t' extern size_t __mbstowcs_chk (wchar_t *__restrict __dst, ^ /usr/include/i386-linux-gnu/bits/stdlib.h:100:10: error: unknown type name 'size_t' size_t __len, size_t __dstlen) __THROW; ^ /usr/include/i386-linux-gnu/bits/stdlib.h:100:24: error: unknown type name 'size_t' size_t __len, size_t __dstlen) __THROW; ^ /usr/include/i386-linux-gnu/bits/stdlib.h:101:1: error: unknown type name 'size_t' extern size_t __REDIRECT_NTH (__mbstowcs_alias, ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdlib.h:24, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib.h:101:15: error: unknown type name 'size_t' extern size_t __REDIRECT_NTH (__mbstowcs_alias, ^ In file included from /usr/include/stdlib.h:959:0, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib.h:105:1: error: unknown type name 'size_t' extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn, ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdlib.h:24, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib.h:105:15: error: unknown type name 'size_t' extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn, ^ /usr/include/i386-linux-gnu/bits/stdlib.h:105:15: error: unknown type name 'size_t' extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn, ^ /usr/include/i386-linux-gnu/bits/stdlib.h:113:1: error: expected ',' or ';' before 'mbstowcs' __NTH (mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src, ^ In file included from /usr/include/stdlib.h:959:0, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib.h:130:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__wcstombs_chk' extern size_t __wcstombs_chk (char *__restrict __dst, ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdlib.h:24, from sumprod.c:2: /usr/include/i386-linux-gnu/bits/stdlib.h:133:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__wcstombs_alias' extern size_t __REDIRECT_NTH (__wcstombs_alias, ^ /usr/include/i386-linux-gnu/bits/stdlib.h:137:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__wcstombs_chk_warn' extern size_t __REDIRECT_NTH (__wcstombs_chk_warn, ^ /usr/include/i386-linux-gnu/bits/stdlib.h:144:1: error: expected ',' or ';' before 'wcstombs' __NTH (wcstombs (char *__restrict __dst, const wchar_t *__restrict __src, ^ sumprod.c: In function 'main': sumprod.c:7:5: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] scanf("%d%d%d", &a,&b,&c); ^ sumprod.c:7:5: warning: incompatible implicit declaration of built-in function 'scanf' [enabled by default] sumprod.c:8:10: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if (a<b<c){ ^ sumprod.c:11:10: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if (b<a<c){ ^ sumprod.c:14:10: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if (a<c<b){ ^ sumprod.c:17:10: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if (b<a<c){ ^ sumprod.c:20:10: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if (b<c<a){ ^ sumprod.c:23:10: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if (c<b<a){ ^ sumprod.c:26:10: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if (c<a<b){ ^ sumprod.c:29:6: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] printf("%d",R); ^ sumprod.c:29:6: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default]
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumProd face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.