#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 | #53892568 | Utilizator | |
Fișier | memory002.cpp | Dimensiune | 603 B |
Data încărcării | 14 Noiembrie 2024, 09:32 | Scor / rezultat | Eroare de compilare |
memory002.cpp: In function 'int main()': memory002.cpp:9:17: error: 'INT_MAX' was not declared in this scope int n,a,t,min=INT_MAX,mx=-1,st,dr,s=0; ^ memory002.cpp:17:10: error: 'st' was not declared in this scope st=i; ^ memory002.cpp:19:14: error: 'mx' was not declared in this scope if(a>mx) ^ memory002.cpp:21:13: error: overloaded function with no contextual type information max=a; ^ memory002.cpp:22:10: error: 'dr' was not declared in this scope dr=i; ^ memory002.cpp:25:10: error: 'st' was not declared in this scope if(st>dr) ^ memory002.cpp:25:13: error: 'dr' was not declared in this scope if(st>dr) ^ memory002.cpp:31:14: error: 'st' was not declared in this scope if(i>=st && i<=dr) ^ memory002.cpp:31:23: error: 'dr' was not declared in this scope if(i>=st && i<=dr) ^ memory002.cpp:32:8: error: 's' was not declared in this scope s+=a; ^ memory002.cpp:34:9: error: 's' was not declared in this scope fout<<s; ^ memory002.cpp:9:11: warning: unused variable 't' [-Wunused-variable] int n,a,t,min=INT_MAX,mx=-1,st,dr,s=0; ^
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ă.