#3330
CalculCombinari
Se dau numerele naturale n
și k
. Calculați \( C_n^k \).
Problema | CalculCombinari | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52978711 | Utilizator | |
Fișier | calculcombinari.cpp | Dimensiune | 367 B |
Data încărcării | 14 Octombrie 2024, 19:20 | Scor / rezultat | Eroare de compilare |
calculcombinari.cpp: In function 'int main()': calculcombinari.cpp:5:10: error: expected primary-expression before '>>' token cin>>n>>k; ^ calculcombinari.cpp:5:13: error: expected primary-expression before ';' token cin>>n>>k; ^ calculcombinari.cpp:6:5: error: expected unqualified-id before '=' token l=1; ^ calculcombinari.cpp:7:5: error: expected unqualified-id before '=' token v=1; ^ calculcombinari.cpp:8:5: error: expected unqualified-id before '=' token j=1; ^ calculcombinari.cpp:9:6: error: expected unqualified-id before '=' token P1=1; ^ calculcombinari.cpp:10:6: error: expected unqualified-id before '=' token P2=1; ^ calculcombinari.cpp:11:6: error: expected unqualified-id before '=' token P3=1; ^ calculcombinari.cpp:12:11: error: expected primary-expression before '<=' token while(l<=n) ^ calculcombinari.cpp:12:14: error: expected primary-expression before ')' token while(l<=n) ^ calculcombinari.cpp:13:8: error: expected unqualified-id before '=' token { P1=P1*l; ^ calculcombinari.cpp:14:7: error: expected unqualified-id before '++' token l++; ^ calculcombinari.cpp:17:11: error: expected primary-expression before '<=' token while(v<=k) ^ calculcombinari.cpp:17:14: error: expected primary-expression before ')' token while(v<=k) ^ calculcombinari.cpp:18:8: error: expected unqualified-id before '=' token { P2=P2*v; ^ calculcombinari.cpp:19:7: error: expected unqualified-id before '++' token v++; ^ calculcombinari.cpp:22:11: error: expected primary-expression before '<=' token while(j<=(n-k)) ^ calculcombinari.cpp:22:15: error: expected primary-expression before '-' token while(j<=(n-k)) ^ calculcombinari.cpp:22:17: error: expected primary-expression before ')' token while(j<=(n-k)) ^ calculcombinari.cpp:23:8: error: expected unqualified-id before '=' token { P3=P3*j; ^ calculcombinari.cpp:24:7: error: expected unqualified-id before '++' token j++; ^ calculcombinari.cpp:27:12: error: expected primary-expression before '/' token cout<<P1/(P2*P3); ^ calculcombinari.cpp:27:16: error: expected primary-expression before '*' token cout<<P1/(P2*P3); ^ calculcombinari.cpp:27:19: error: expected primary-expression before ')' token cout<<P1/(P2*P3); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CalculCombinari 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ă.