#652
AfisareFii
Se dă vectorul de tați al unui arbore cu rădăcină cu n
noduri și k
noduri distincte din arbore. Afișați fiii fiecăruia dintre cele k
noduri.
Problema | AfisareFii | Operații I/O |
afisarefii.in /afisarefii.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #46808509 | Utilizator | |
Fișier | afisarefii.cpp | Dimensiune | 626 B |
Data încărcării | 23 Noiembrie 2023, 13:05 | Scor / rezultat | Eroare de compilare |
afisarefii.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream cout("afisarefii.out") ^ afisarefii.cpp: In function 'int main()': afisarefii.cpp:10:5: error: reference to 'cin' is ambiguous cin>> n; ^ afisarefii.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("afisarefii.in") ^ In file included from afisarefii.cpp:2:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ afisarefii.cpp:10:11: error: 'n' was not declared in this scope cin>> n; ^ afisarefii.cpp:11:9: error: 'i' was not declared in this scope for(i =1 ; i<=n; i++) ^ afisarefii.cpp:12:9: error: reference to 'cin' is ambiguous cin>> t[i]; ^ afisarefii.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("afisarefii.in") ^ In file included from afisarefii.cpp:2:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ afisarefii.cpp:12:15: error: 't' was not declared in this scope cin>> t[i]; ^ afisarefii.cpp:13:5: error: reference to 'cin' is ambiguous cin >>k; ^ afisarefii.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("afisarefii.in") ^ In file included from afisarefii.cpp:2:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ afisarefii.cpp:13:11: error: 'k' was not declared in this scope cin >>k; ^ afisarefii.cpp:14:9: error: 'j' was not declared in this scope for(j=1; j<=k; j++){ ^ afisarefii.cpp:15:9: error: reference to 'cin' is ambiguous cin>>x; ^ afisarefii.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("afisarefii.in") ^ In file included from afisarefii.cpp:2:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ afisarefii.cpp:15:14: error: 'x' was not declared in this scope cin>>x; ^ afisarefii.cpp:16:9: error: 'y' was not declared in this scope y=0; ^ afisarefii.cpp:17:13: error: 'i' was not declared in this scope for(i =1; i<=n; i++) ^ afisarefii.cpp:18:17: error: 't' was not declared in this scope if (t[i]==x){ ^ afisarefii.cpp:22:13: error: 'i' was not declared in this scope for(i =1; i<=n; i++) ^ afisarefii.cpp:23:17: error: 't' was not declared in this scope if (t[i]==x){ ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AfisareFii 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ă.