#117
CreareNumar1
C++
Scrieți definiția completă a subprogramului numar
, care primește prin intermediul parametrului n
un număr natural nenul (1≤n≤100
), iar prin intermediul parametrului a
, un tablou unidimensional care conţine n
valori naturale
Subprogramul furnizează prin parametrul k
o valoare naturală egală cu numărul obţinut prin concatenarea valorii maxime cu valoarea minimă din tablou.
Variante Bacalaureat 2009
Problema | CreareNumar1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54530854 | Utilizator | |
Fișier | crearenumar1.cpp | Dimensiune | 663 B |
Data încărcării | 01 Decembrie 2024, 19:10 | Scor / rezultat | Eroare de compilare |
crearenumar1.cpp: In function 'void numar(int, int*, int&)': crearenumar1.cpp:12:5: error: expected ';' before 'int' int nr = 0,p1 = 1,p2=1,p3 = 1, s1 = 0, s2 = 0,cif = 0, ct; ^ crearenumar1.cpp:15:9: error: 'cif' was not declared in this scope cif = n%10; ^ crearenumar1.cpp:16:9: error: 's1' was not declared in this scope s1 = (s + cif)*p; ^ crearenumar1.cpp:16:15: error: 's' was not declared in this scope s1 = (s + cif)*p; ^ crearenumar1.cpp:16:24: error: 'p' was not declared in this scope s1 = (s + cif)*p; ^ crearenumar1.cpp:17:9: error: 'p1' was not declared in this scope p1=p*10; ^ crearenumar1.cpp:19:9: error: 'ct' was not declared in this scope ct += 1; ^ crearenumar1.cpp:24:9: error: 'cif' was not declared in this scope cif = n%10; ^ crearenumar1.cpp:25:9: error: 's2' was not declared in this scope s2 = (s + cif)*p; ^ crearenumar1.cpp:25:15: error: 's' was not declared in this scope s2 = (s + cif)*p; ^ crearenumar1.cpp:25:24: error: 'p' was not declared in this scope s2 = (s + cif)*p; ^ crearenumar1.cpp:26:9: error: 'p2' was not declared in this scope p2=p*10; ^ crearenumar1.cpp:28:9: error: 'ct' was not declared in this scope ct += 1; ^ crearenumar1.cpp:31:11: error: 'ct' was not declared in this scope while(ct > 0) ^ crearenumar1.cpp:33:9: error: 'p3' was not declared in this scope p3 = p3*10; ^ crearenumar1.cpp:36:9: error: 's1' was not declared in this scope k = s1 * p3 + s2; ^ crearenumar1.cpp:36:14: error: 'p3' was not declared in this scope k = s1 * p3 + s2; ^ crearenumar1.cpp:36:19: error: 's2' was not declared in this scope k = s1 * p3 + s2; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CreareNumar1 face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.