#1174
Să se scrie o funcție C++ care determină câte perechi de elemente prime între ele sunt memorate într-o lista simplu înlănțuită.
| Problema | FListaNumarare2 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64745112 | Utilizator | |
| Fișier | flistanumarare2.cpp | Dimensiune | 443 B |
| Data încărcării | 27 Mai 2026, 12:31 | Scor/rezultat | Eroare de compilare |
flistanumarare2.cpp: In function ‘int cmmdc(int, int)’: flistanumarare2.cpp:43:9: error: ‘r’ was not declared in this scope 43 | r=a%b; | ^ flistanumarare2.cpp:50:1: error: a function-definition is not allowed here before ‘{’ token 50 | { | ^ flistanumarare2.cpp:69:1: error: a function-definition is not allowed here before ‘{’ token 69 | { | ^ flistanumarare2.cpp:80:1: error: a function-definition is not allowed here before ‘{’ token 80 | { | ^ flistanumarare2.cpp:89:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 89 | int main() | ^~ flistanumarare2.cpp:89:9: note: remove parentheses to default-initialize a variable 89 | int main() | ^~ | -- flistanumarare2.cpp:89:9: note: or replace parentheses with braces to value-initialize a variable flistanumarare2.cpp:90:1: error: a function-definition is not allowed here before ‘{’ token 90 | { | ^ flistanumarare2.cpp:98:2: error: expected ‘}’ at end of input 98 | } | ^ flistanumarare2.cpp:38:1: note: to match this ‘{’ 38 | { | ^ flistanumarare2.cpp:40:16: warning: control reaches end of non-void function [-Wreturn-type] 40 | cout<<-1; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FListaNumarare2 face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.