#1446
Memory002
Fiind dat un şir format din n
numere naturale distincte să se calculeze suma elementelor din secvenţa ce uneşte cel mai mic şi cel mai mare element din şir, inclusiv acestea.
Problema | Memory002 | Operații I/O |
memory002.in /memory002.out
|
---|---|---|---|
Limita timp | 0.15 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0 MB
|
Id soluție | #1543337 | Utilizator | |
Fișier | memory002.cpp | Dimensiune | 697 B |
Data încărcării | 14 Ianuarie 2016, 12:49 | Scor / rezultat | 40 puncte |
memory002.cpp: In function 'int main()': memory002.cpp:9:24: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=] fscanf(pFile, "%d", &n); ^ memory002.cpp:45:29: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=] fprintf(pFile2, "%d", total); ^ memory002.cpp:9:25: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] fscanf(pFile, "%d", &n); ^ memory002.cpp:13:26: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] fscanf(pFile, "%d", &x); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | OK. | 20 | 20 | Exemplu | |
2 | 0 secunde | OK. | 20 | 20 | ||
3 | 0.032 secunde | Raspuns gresit. | 20 | 0 | ||
4 | 0.08 secunde | Raspuns gresit. | 20 | 0 | ||
5 | 0.048 secunde | Raspuns gresit. | 20 | 0 | ||
Punctaj total | 40 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Memory002 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ă.