#4280
MaxDivK
Se citesc de la tastatură numerele n k
, apoi un șir de n
numere naturale. Să se determine cel mai mare număr din șir care se divide cu k
.
Problema | MaxDivK | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55092547 | Utilizator | |
Fișier | maxdivk.cpp | Dimensiune | 2.23 KB |
Data încărcării | 22 Decembrie 2024, 14:30 | Scor / rezultat | Eroare de compilare |
maxdivk.cpp:50:1: error: stray '\310' in program Explicație: ^ maxdivk.cpp:50:1: error: stray '\233' in program maxdivk.cpp:54:1: error: stray '\304' in program n reprezintă numărul de elemente din șir. ^ maxdivk.cpp:54:1: error: stray '\203' in program maxdivk.cpp:54:1: error: stray '\304' in program maxdivk.cpp:54:1: error: stray '\203' in program maxdivk.cpp:54:1: error: stray '\310' in program maxdivk.cpp:54:1: error: stray '\231' in program maxdivk.cpp:56:1: error: stray '\304' in program k este numărul cu care verificăm divizibilitatea. ^ maxdivk.cpp:56:1: error: stray '\203' in program maxdivk.cpp:56:1: error: stray '\304' in program maxdivk.cpp:56:1: error: stray '\203' in program maxdivk.cpp:58:1: error: stray '\310' in program Se citește un șir de n numere naturale și se stochează într-un vector. ^ maxdivk.cpp:58:1: error: stray '\231' in program maxdivk.cpp:58:1: error: stray '\310' in program maxdivk.cpp:58:1: error: stray '\231' in program maxdivk.cpp:58:1: error: stray '\310' in program maxdivk.cpp:58:1: error: stray '\231' in program maxdivk.cpp:58:1: error: stray '\304' in program maxdivk.cpp:58:1: error: stray '\203' in program maxdivk.cpp:58:1: error: stray '\303' in program maxdivk.cpp:58:1: error: stray '\256' in program maxdivk.cpp:62:1: error: stray '\304' in program 2. Verificări inițiale: ^ maxdivk.cpp:62:1: error: stray '\203' in program maxdivk.cpp:62:1: error: stray '\310' in program maxdivk.cpp:62:1: error: stray '\233' in program maxdivk.cpp:64:1: error: stray '\304' in program n nu trebuie să fie mai mare decât 50. ^ maxdivk.cpp:64:1: error: stray '\203' in program maxdivk.cpp:64:1: error: stray '\303' in program maxdivk.cpp:64:1: error: stray '\242' in program maxdivk.cpp:66:1: error: stray '\304' in program Toate numerele trebuie să fie mai mici decât 10.000. ^ maxdivk.cpp:66:1: error: stray '\203' in program maxdivk.cpp:66:1: error: stray '\303' in program maxdivk.cpp:66:1: error: stray '\242' in program maxdivk.cpp:66:48: error: too many decimal points in number Toate numerele trebuie să fie mai mici decât 10.000. ^ maxdivk.cpp:68:1: error: stray '\304' in program k trebuie să fie strict pozitiv. ^ maxdivk.cpp:68:1: error: stray '\203' in program maxdivk.cpp:74:1: error: stray '\310' in program Se parcurge șirul și se verifică dacă fiecare element este divizibil cu k. ^ maxdivk.cpp:74:1: error: stray '\231' in program maxdivk.cpp:74:1: error: stray '\310' in program maxdivk.cpp:74:1: error: stray '\231' in program maxdivk.cpp:74:1: error: stray '\304' in program maxdivk.cpp:74:1: error: stray '\203' in program maxdivk.cpp:74:1: error: stray '\304' in program maxdivk.cpp:74:1: error: stray '\203' in program maxdivk.cpp:76:1: error: stray '\310' in program Se ține evidența celui mai mare număr divizibil cu k folosind variabila maxDivizibil. Inițial, această variabilă este setată la -1. ^ maxdivk.cpp:76:1: error: stray '\233' in program maxdivk.cpp:76:1: error: stray '\310' in program maxdivk.cpp:76:1: error: stray '\233' in program maxdivk.cpp:76:1: error: stray '\304' in program maxdivk.cpp:76:1: error: stray '\203' in program maxdivk.cpp:76:1: error: stray '\310' in program maxdivk.cpp:76:1: error: stray '\233' in program maxdivk.cpp:76:1: error: stray '\304' in program maxdivk.cpp:76:1: error: stray '\203' in program maxdivk.cpp:76:1: error: stray '\304' in program maxdivk.cpp:76:1: error: stray '\203' in program maxdivk.cpp:76:1: error: stray '\304' in program maxdivk.cpp:76:1: error: stray '\203' in program maxdivk.cpp:80:1: error: stray '\310' in program 4. Afișarea rezultatului: ^ maxdivk.cpp:80:1: error: stray '\231' in program maxdivk.cpp:82:1: error: stray '\304' in program Dacă nu există niciun număr divizibil cu k, se afișează mesajul "Nu Exista". ^ maxdivk.cpp:82:1: error: stray '\203' in program maxdivk.cpp:82:1: error: stray '\304' in program maxdivk.cpp:82:1: error: stray '\203' in program maxdivk.cpp:82:1: error: stray '\304' in program maxdivk.cpp:82:1: error: stray '\203' in program maxdivk.cpp:82:1: error: stray '\310' in program maxdivk.cpp:82:1: error: stray '\231' in program maxdivk.cpp:82:1: error: stray '\304' in program maxdivk.cpp:82:1: error: stray '\203' in program maxdivk.cpp:84:1: error: stray '\303' in program În caz contrar, se afișează valoarea maximă găsită. ^ maxdivk.cpp:84:1: error: stray '\216' in program maxdivk.cpp:84:1: error: stray '\310' in program maxdivk.cpp:84:1: error: stray '\231' in program maxdivk.cpp:84:1: error: stray '\304' in program maxdivk.cpp:84:1: error: stray '\203' in program maxdivk.cpp:84:1: error: stray '\304' in program maxdivk.cpp:84:1: error: stray '\203' in program maxdivk.cpp:84:1: error: stray '\304' in program maxdivk.cpp:84:1: error: stray '\203' in program maxdivk.cpp:84:1: error: stray '\304' in program maxdivk.cpp:84:1: error: stray '\203' in program maxdivk.cpp:93:1: error: stray '\310' in program Introduceți valoarea lui n: 5 ^ maxdivk.cpp:93:1: error: stray '\233' in program maxdivk.cpp:94:1: error: stray '\310' in program Introduceți valoarea lui k: 3 ^ maxdivk.cpp:94:1: error: stray '\233' in program maxdivk.cpp:95:1: error: stray '\310' in program Introduceți 5 numere naturale: 9 15 7 12 5 ^ maxdivk.cpp:95:1: error: stray '\233' in program maxdivk.cpp:97:1: error: stray '\310' in program Ieșire: ^ maxdivk.cpp:97:1: error: stray '\231' in program maxdivk.cpp:103:1: error: stray '\310' in program Introduceți valoarea lui n: 4 ^ maxdivk.cpp:103:1: error: stray '\233' in program maxdivk.cpp:104:1: error: stray '\310' in program Introduceți valoarea lui k: 10 ^ maxdivk.cpp:104:1: error: stray '\233' in program maxdivk.cpp:105:1: error: stray '\310' in program Introduceți 4 numere naturale: 7 3 1 2 ^ maxdivk.cpp:105:1: error: stray '\233' in program maxdivk.cpp:107:1: error: stray '\310' in program Ieșire: ^ maxdivk.cpp:107:1: error: stray '\231' in program maxdivk.cpp:50:1: error: 'Explica' does not name a type Explicație: ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MaxDivK 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ă.