#32
EliminareCifre
C++
Să se scrie definiția completă a funcției C++ P
care primește prin intermediul parametrului n
un număr natural cu cel mult 9
cifre, iar prin intermediul parametrului c
o cifră. Funcția întoarce tot prin intermediul parametrului n
numărul obținut prin eliminarea tuturor aparițiilor cifrei c
.
Variante Bacalaureat 2009
Problema | EliminareCifre | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #22947442 | Utilizator | |
Fișier | eliminarecifre.cpp | Dimensiune | 319 B |
Data încărcării | 14 Mai 2020, 11:00 | Scor / rezultat | Eroare de compilare |
eliminarecifre.cpp:4:9: error: #include expects "FILENAME" or <FILENAME> #include <iostream> ^ eliminarecifre.cpp:5:1: error: stray '\302' in program using namespace std; ^ eliminarecifre.cpp:5:1: error: stray '\240' in program eliminarecifre.cpp:5:1: error: stray '\302' in program eliminarecifre.cpp:5:1: error: stray '\240' in program eliminarecifre.cpp:7:1: error: stray '\302' in program void P(int & n, int c) ^ eliminarecifre.cpp:7:1: error: stray '\240' in program eliminarecifre.cpp:7:1: error: stray '\302' in program eliminarecifre.cpp:7:1: error: stray '\240' in program eliminarecifre.cpp:7:1: error: stray '\302' in program eliminarecifre.cpp:7:1: error: stray '\240' in program eliminarecifre.cpp:7:1: error: stray '\302' in program eliminarecifre.cpp:7:1: error: stray '\240' in program eliminarecifre.cpp:7:1: error: stray '\302' in program eliminarecifre.cpp:7:1: error: stray '\240' in program eliminarecifre.cpp:9:1: error: stray '\302' in program int sol = 0, p = 1; ^ eliminarecifre.cpp:9:1: error: stray '\240' in program eliminarecifre.cpp:9:1: error: stray '\302' in program eliminarecifre.cpp:9:1: error: stray '\240' in program eliminarecifre.cpp:9:1: error: stray '\302' in program eliminarecifre.cpp:9:1: error: stray '\240' in program eliminarecifre.cpp:9:1: error: stray '\302' in program eliminarecifre.cpp:9:1: error: stray '\240' in program eliminarecifre.cpp:9:1: error: stray '\302' in program eliminarecifre.cpp:9:1: error: stray '\240' in program eliminarecifre.cpp:9:1: error: stray '\302' in program eliminarecifre.cpp:9:1: error: stray '\240' in program eliminarecifre.cpp:10:1: error: stray '\302' in program while(n) { ^ eliminarecifre.cpp:10:1: error: stray '\240' in program eliminarecifre.cpp:11:1: error: stray '\302' in program if(n % 10 != c) ^ eliminarecifre.cpp:11:1: error: stray '\240' in program eliminarecifre.cpp:11:1: error: stray '\302' in program eliminarecifre.cpp:11:1: error: stray '\240' in program eliminarecifre.cpp:11:1: error: stray '\302' in program eliminarecifre.cpp:11:1: error: stray '\240' in program eliminarecifre.cpp:11:1: error: stray '\302' in program eliminarecifre.cpp:11:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program sol = sol + (n % 10) * p, p *= 10; ^ eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:12:1: error: stray '\302' in program eliminarecifre.cpp:12:1: error: stray '\240' in program eliminarecifre.cpp:13:1: error: stray '\302' in program n /= 10; ^ eliminarecifre.cpp:13:1: error: stray '\240' in program eliminarecifre.cpp:13:1: error: stray '\302' in program eliminarecifre.cpp:13:1: error: stray '\240' in program eliminarecifre.cpp:15:1: error: stray '\302' in program n = sol; // mda pro ^ eliminarecifre.cpp:15:1: error: stray '\240' in program eliminarecifre.cpp:15:1: error: stray '\302' in program eliminarecifre.cpp:15:1: error: stray '\240' in program eliminarecifre.cpp:15:1: error: stray '\302' in program eliminarecifre.cpp:15:1: error: stray '\240' in program eliminarecifre.cpp:17:1: error: stray '\302' in program int main() ^ eliminarecifre.cpp:17:1: error: stray '\240' in program eliminarecifre.cpp:19:1: error: stray '\302' in program int n, c; ^ eliminarecifre.cpp:19:1: error: stray '\240' in program eliminarecifre.cpp:19:1: error: stray '\302' in program eliminarecifre.cpp:19:1: error: stray '\240' in program eliminarecifre.cpp:20:1: error: stray '\302' in program cin >> n >> c; ^ eliminarecifre.cpp:20:1: error: stray '\240' in program eliminarecifre.cpp:20:1: error: stray '\302' in program eliminarecifre.cpp:20:1: error: stray '\240' in program eliminarecifre.cpp:20:1: error: stray '\302' in program eliminarecifre.cpp:20:1: error: stray '\240' in program eliminarecifre.cpp:20:1: error: stray '\302' in program eliminarecifre.cpp:20:1: error: stray '\240' in program eliminarecifre.cpp:21:1: error: stray '\302' in program P(n, c); ^ eliminarecifre.cpp:21:1: error: stray '\240' in program eliminarecifre.cpp:22:1: error: stray '\302' in program cout << n; ^ eliminarecifre.cpp:22:1: error: stray '\240' in program eliminarecifre.cpp:22:1: error: stray '\302' in program eliminarecifre.cpp:22:1: error: stray '\240' in program eliminarecifre.cpp:23:1: error: stray '\302' in program return 0; ^ eliminarecifre.cpp:23:1: error: stray '\240' in program eliminarecifre.cpp: In function 'int main()': eliminarecifre.cpp:26:5: error: redefinition of 'int main()' int main(){ ^ eliminarecifre.cpp:17:6: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema EliminareCifre 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ă.