#2082
Sierpinski
Se dă un număr natural n
. Să se genereze o matrice pătratică de ordinul 3
n
, cu elemente din mulțimea {0, 1}
, după modelul covorului lui Sierpinski.
Problema | Sierpinski | Operații I/O |
sierpinski.in /sierpinski.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 0.2 MB
/
Stivă 0.2 MB
|
Id soluție | #54915792 | Utilizator | |
Fișier | sierpinski.cpp | Dimensiune | 1.23 KB |
Data încărcării | 12 Decembrie 2024, 09:29 | Scor / rezultat | Eroare de compilare |
sierpinski.cpp:22:14: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin ("sierpinski.in"); ^ sierpinski.cpp:23:15: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout ("sierpinski.out") ^ sierpinski.cpp:24:1: error: expected ',' or ';' before 'int' int n, l; ^ sierpinski.cpp: In function 'int main()': sierpinski.cpp:46:5: error: reference to 'cin' is ambiguous cin>>n; ^ sierpinski.cpp:22:10: note: candidates are: <typeprefixerror>cin ifstream cin ("sierpinski.in"); ^ In file included from sierpinski.cpp:16:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ sierpinski.cpp:46:10: error: 'n' was not declared in this scope cin>>n; ^ sierpinski.cpp:47:5: error: 'l' was not declared in this scope l=pow(3,n); ^ sierpinski.cpp:50:25: error: reference to 'cout' is ambiguous for(i=1; i<=l; i++, cout<<'\n') ^ sierpinski.cpp:23:10: note: candidates are: <typeprefixerror>cout ofstream cout ("sierpinski.out") ^ In file included from sierpinski.cpp:16:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ sierpinski.cpp:52:9: error: reference to 'cout' is ambiguous cout<<a[i][j]<<" "; ^ sierpinski.cpp:23:10: note: candidates are: <typeprefixerror>cout ofstream cout ("sierpinski.out") ^ In file included from sierpinski.cpp:16:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Sierpinski 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ă.