#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 | #54530849 | Utilizator | |
Fișier | crearenumar1.cpp | Dimensiune | 706 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:14:5: error: expected ';' before 'int' int nr = 0,p1 = 1,p2=1,p3 = 1, s1 = 0, s2 = 0,cif = 0, ct; ^ crearenumar1.cpp:17:9: error: 'cif' was not declared in this scope cif = n%10; ^ crearenumar1.cpp:18:9: error: 's1' was not declared in this scope s1 = (s + cif)*p; ^ crearenumar1.cpp:18:15: error: 's' was not declared in this scope s1 = (s + cif)*p; ^ crearenumar1.cpp:18:24: error: 'p' was not declared in this scope s1 = (s + cif)*p; ^ crearenumar1.cpp:19:9: error: 'p1' was not declared in this scope p1=p*10; ^ crearenumar1.cpp:21:9: error: 'ct' was not declared in this scope ct += 1; ^ crearenumar1.cpp:26:9: error: 'cif' was not declared in this scope cif = n%10; ^ crearenumar1.cpp:27:9: error: 's2' was not declared in this scope s2 = (s + cif)*p; ^ crearenumar1.cpp:27:15: error: 's' was not declared in this scope s2 = (s + cif)*p; ^ crearenumar1.cpp:27:24: error: 'p' was not declared in this scope s2 = (s + cif)*p; ^ crearenumar1.cpp:28:9: error: 'p2' was not declared in this scope p2=p*10; ^ crearenumar1.cpp:30:9: error: 'ct' was not declared in this scope ct += 1; ^ crearenumar1.cpp:33:11: error: 'ct' was not declared in this scope while(ct > 0) ^ crearenumar1.cpp:35:9: error: 'p3' was not declared in this scope p3 = p3*10; ^ crearenumar1.cpp:38:9: error: 's1' was not declared in this scope k = s1 * p3 + s2; ^ crearenumar1.cpp:38:14: error: 'p3' was not declared in this scope k = s1 * p3 + s2; ^ crearenumar1.cpp:38: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ă.