#2709
Se organizează o excursie cu n participanți cu numere de ordine unice de la 1 la n pentru care se folosesc 3 mijloace de transport. Să se determine dacă se pot aranja participanții astfel încât suma numerelor de ordine din cele 3 mașini să fie aceeași. Dacă este posibilă aranjarea, se vor afișa pe 3 linii numerele de ordine separate prin spații, numerele dintr-o mașină pe câte un rând, altfel se afișează NU.
| Problema | Excursie2 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 8 MB
/
Stivă 8 MB
|
| Id soluție | #64344488 | Utilizator | |
| Fișier | excursie2.cpp | Dimensiune | 1.94 KB |
| Data încărcării | 30 Aprilie 2026, 17:26 | Scor/rezultat | Eroare de compilare |
excursie2.cpp: In function ‘int main()’: excursie2.cpp:18:10: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 18 | for(i = 1; i <= n; i += 6) | ^~~ excursie2.cpp:20:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 20 | cout << '\n'; | ^~~~ excursie2.cpp:21:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 21 | for(i = 2; i <= n; i += 6) | ^~~ excursie2.cpp:23:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 23 | cout << '\n'; | ^~~~ excursie2.cpp:34:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 34 | for(i = 2; i <= n; i += 5) | ^~~ excursie2.cpp:36:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 36 | cout << '\n'; | ^~~~ excursie2.cpp:44:12: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 44 | for(i = 1; i <= n; i += 8) | ^~~ excursie2.cpp:46:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 46 | cout << '\n'; | ^~~~ excursie2.cpp:47:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 47 | for(i = 2; i <= n; i += 8) | ^~~ excursie2.cpp:49:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 49 | cout << '\n'; | ^~~~ excursie2.cpp:57:12: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 57 | for(i = 1; i <= n; i += 9) | ^~~ excursie2.cpp:59:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 59 | cout << '\n'; | ^~~~ excursie2.cpp:60:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 60 | for(i = 2; i <= n; i += 9) | ^~~ excursie2.cpp:62:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 62 | cout << '\n'; | ^~~~ excursie2.cpp:68:8: error: ‘fout’ was not declared in this scope 68 | fout << "NU" return 0; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Excursie2 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ă.