#4718
Cu cifrele de la 1 la 9 construim un triunghi astfel:
1
2 3
4 5 6
7 8 9 1
2 3 4 5 6
7 8 9 1 2 3
.................
Dându-se L şi C două numere naturale, să se determine a C-a cifră care se află pe linia L din acest triunghi, considerând că liniile se numerotează de la 1.
Concurs de selecție clasa a 9-a Centru de Excelență în Informatică 2024 - Vaslui
| Problema | TriunghiCif | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 4 MB
/
Stivă 2 MB
|
| Id soluție | #64731416 | Utilizator | |
| Fișier | triunghicif.cpp | Dimensiune | 207 B |
| Data încărcării | 26 Mai 2026, 16:05 | Scor/rezultat | Eroare de compilare |
triunghicif.cpp: In function ‘int main()’: triunghicif.cpp:8:1: warning: statement has no effect [-Wunused-value] 8 | 1; | ^ triunghicif.cpp:9:2: error: expected ‘;’ before numeric constant 9 | 2 3; | ^~ | ; triunghicif.cpp:9:1: warning: statement has no effect [-Wunused-value] 9 | 2 3; | ^ triunghicif.cpp:10:2: error: expected ‘;’ before numeric constant 10 | 4 5 6; | ^~ | ; triunghicif.cpp:10:1: warning: statement has no effect [-Wunused-value] 10 | 4 5 6; | ^ triunghicif.cpp:11:2: error: expected ‘;’ before numeric constant 11 | 7 8 9 1; | ^~ | ; triunghicif.cpp:11:1: warning: statement has no effect [-Wunused-value] 11 | 7 8 9 1; | ^ triunghicif.cpp:12:2: error: expected ‘;’ before numeric constant 12 | 2 3 4 5 6; | ^~ | ; triunghicif.cpp:12:1: warning: statement has no effect [-Wunused-value] 12 | 2 3 4 5 6; | ^ triunghicif.cpp:13:2: error: expected ‘;’ before numeric constant 13 | 7 8 9 1 2 3; | ^~ | ; triunghicif.cpp:13:1: warning: statement has no effect [-Wunused-value] 13 | 7 8 9 1 2 3; | ^ triunghicif.cpp:14:2: error: expected ‘;’ before numeric constant 14 | 4 5 6 7 8 9 1; | ^~ | ; triunghicif.cpp:14:1: warning: statement has no effect [-Wunused-value] 14 | 4 5 6 7 8 9 1; | ^ triunghicif.cpp:15:2: error: expected ‘;’ before numeric constant 15 | 2 3 4 5 6 7 8 9; | ^~ | ; triunghicif.cpp:15:1: warning: statement has no effect [-Wunused-value] 15 | 2 3 4 5 6 7 8 9; | ^ triunghicif.cpp:16:1: error: expected primary-expression before ‘...’ token 16 | ................. | ^~~ triunghicif.cpp:7:9: warning: unused variable ‘a’ [-Wunused-variable] 7 | int a,b,x; | ^ triunghicif.cpp:7:11: warning: unused variable ‘b’ [-Wunused-variable] 7 | int a,b,x; | ^ triunghicif.cpp:7:13: warning: unused variable ‘x’ [-Wunused-variable] 7 | int a,b,x; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema TriunghiCif 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ă.