#3910
Se citesc trei numere naturale a b n. Să se afișeze, în ordine lexicografică, șirurile cu n elemente distincte din mulțimea {a, a + 1, ..., b}.
| Problema | Aranjamente1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64245875 | Utilizator | |
| Fișier | aranjamente1.cpp | Dimensiune | 810 B |
| Data încărcării | 25 Aprilie 2026, 13:00 | Scor/rezultat | Eroare de compilare |
aranjamente1.cpp: In function ‘void afis(int)’: aranjamente1.cpp:8:7: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 8 | for(int i=1; i<=k; i++) | ^~~ aranjamente1.cpp:10:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 10 | cout<<endl; | ^~~~ aranjamente1.cpp: In function ‘bool ok(int)’: aranjamente1.cpp:15:6: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 15 | for(int i=1; i<=k-1; i++) | ^~~ aranjamente1.cpp:18:10: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 18 | return 1; | ^~~~~~ aranjamente1.cpp: In function ‘void backtracking(int)’: aranjamente1.cpp:30:18: error: ‘a’ was not declared in this scope 30 | for (int i=a; i<=b; i++) | ^ aranjamente1.cpp:30:24: error: ‘b’ was not declared in this scope 30 | for (int i=a; i<=b; i++) | ^ aranjamente1.cpp:33:15: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 33 | if(ok(k)==1) | ^ aranjamente1.cpp: In function ‘int main()’: aranjamente1.cpp:43:12: error: ‘a’ was not declared in this scope 43 | cin>>a>>b>>n; | ^ aranjamente1.cpp:43:15: error: ‘b’ was not declared in this scope 43 | cin>>a>>b>>n; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Aranjamente1 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ă.