#2082
Se dă un număr natural n. Să se genereze o matrice pătratică de ordinul 3n, 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 | #64652049 | Utilizator | |
| Fișier | sierpinski.cpp | Dimensiune | 784 B |
| Data încărcării | 20 Mai 2026, 16:15 | Scor/rezultat | Eroare de compilare |
sierpinski.cpp: In function ‘int main()’: sierpinski.cpp:28:14: error: expected ‘;’ before ‘i’ 28 | for(int i i=1;i<=n;i++)l=l*3; | ^~ | ; sierpinski.cpp:28:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 28 | for(int i i=1;i<=n;i++)l=l*3; | ~^~ sierpinski.cpp:28:20: warning: for increment expression has no effect [-Wunused-value] 28 | for(int i i=1;i<=n;i++)l=l*3; | ~^~~ sierpinski.cpp:28:23: error: expected ‘)’ before ‘;’ token 28 | for(int i i=1;i<=n;i++)l=l*3; | ~ ^ | ) sierpinski.cpp:28:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 28 | for(int i i=1;i<=n;i++)l=l*3; | ^~~ sierpinski.cpp:28:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 28 | for(int i i=1;i<=n;i++)l=l*3; | ^ sierpinski.cpp:28:24: error: ‘i’ was not declared in this scope
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ă.