#576
Se dă lista arcelor unui graf orientat. Să se afișeze, în ordine lexicografică, toate ciclurile de lungime trei.
| Problema | AfisCicluri | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64907792 | Utilizator | |
| Fișier | afiscicluri.cpp | Dimensiune | 719 B |
| Data încărcării | 11 Iunie 2026, 15:29 | Scor/rezultat | Eroare de compilare |
afiscicluri.cpp: In function ‘void afis()’: afiscicluri.cpp:19:11: error: ‘so1’ was not declared in this scope; did you mean ‘sol’? 19 | cout<<so1[1]<<" "<<so1[2]<<" "<<so1[3]<end]; | ^~~ | sol afiscicluri.cpp: In function ‘void bkt(int, int)’: afiscicluri.cpp:35:1: error: ‘}’ was not declared in this scope 35 | } | ^~ afiscicluri.cpp:42:48: error: ‘il’ was not declared in this scope; did you mean ‘i’? 42 | if ((a[k][i]==1 || a[i][k]==1) && !viz[il) | ^~ | i afiscicluri.cpp:42:50: error: expected ‘]’ before ‘)’ token 42 | if ((a[k][i]==1 || a[i][k]==1) && !viz[il) | ^ | ] afiscicluri.cpp:42:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 42 | if ((a[k][i]==1 || a[i][k]==1) && !viz[il) | ^~ afiscicluri.cpp:46:14: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 46 | viz[i]=0; | ^~~ afiscicluri.cpp:46:18: error: ‘i’ was not declared in this scope 46 | viz[i]=0; | ^ afiscicluri.cpp:50:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 50 | int main() | ^~ afiscicluri.cpp:50:9: note: remove parentheses to default-initialize a variable 50 | int main() | ^~ | -- afiscicluri.cpp:50:9: note: or replace parentheses with braces to value-initialize a variable afiscicluri.cpp:51:1: error: expected initializer before ‘citire’ 51 | citire(); | ^~~~~~ afiscicluri.cpp:52:11: error: expected ‘;’ before ‘-’ token 52 | for (int i-1;i<=n;i++) | ^ | ; afiscicluri.cpp:52:15: warning: for increment expression has no effect [-Wunused-value] 52 | for (int i-1;i<=n;i++) | ~^~~ afiscicluri.cpp:52:18: error: expected ‘)’ before ‘;’ token 52 | for (int i-1;i<=n;i++) | ~ ^ | ) afiscicluri.cpp:52:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 52 | for (int i-1;i<=n;i++) | ^~~ afiscicluri.cpp:52:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 52 | for (int i-1;i<=n;i++) | ^ afiscicluri.cpp:52:19: error: ‘i’ was not declared in this scope afiscicluri.cpp:54:13: error: return-statement with a value, in function returning ‘void’ [-fpermissive] 54 | return 0; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AfisCicluri 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ă.