#633
Paritate1
Se dă un șir cu n
elemente, numere naturale. Determinați diferența în valoare absolută dintre numărul de valori pare din șir și numărul de valori impare din șir.
Problema | Paritate1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #16145491 | Utilizator | |
Fișier | paritate1.cpp | Dimensiune | 367 B |
Data încărcării | 06 Iunie 2019, 22:05 | Scor / rezultat | Eroare de compilare |
paritate1.cpp:1:9: error: #include expects "FILENAME" or <FILENAME> #include <iostream> ^ paritate1.cpp:2:1: error: stray '\302' in program using namespace std; ^ paritate1.cpp:2:1: error: stray '\240' in program paritate1.cpp:2:1: error: stray '\302' in program paritate1.cpp:2:1: error: stray '\240' in program paritate1.cpp:4:1: error: stray '\302' in program int v[1005] , n , nri , nrp; ^ paritate1.cpp:4:1: error: stray '\240' in program paritate1.cpp:4:1: error: stray '\302' in program paritate1.cpp:4:1: error: stray '\240' in program paritate1.cpp:4:1: error: stray '\302' in program paritate1.cpp:4:1: error: stray '\240' in program paritate1.cpp:4:1: error: stray '\302' in program paritate1.cpp:4:1: error: stray '\240' in program paritate1.cpp:4:1: error: stray '\302' in program paritate1.cpp:4:1: error: stray '\240' in program paritate1.cpp:4:1: error: stray '\302' in program paritate1.cpp:4:1: error: stray '\240' in program paritate1.cpp:4:1: error: stray '\302' in program paritate1.cpp:4:1: error: stray '\240' in program paritate1.cpp:6:1: error: stray '\302' in program int main() ^ paritate1.cpp:6:1: error: stray '\240' in program paritate1.cpp:8:1: error: stray '\302' in program cin >> n; ^ paritate1.cpp:8:1: error: stray '\240' in program paritate1.cpp:8:1: error: stray '\302' in program paritate1.cpp:8:1: error: stray '\240' in program paritate1.cpp:9:1: error: stray '\302' in program for(int i = 1 ; i <= n ; ++i) ^ paritate1.cpp:9:1: error: stray '\240' in program paritate1.cpp:9:1: error: stray '\302' in program paritate1.cpp:9:1: error: stray '\240' in program paritate1.cpp:9:1: error: stray '\302' in program paritate1.cpp:9:1: error: stray '\240' in program paritate1.cpp:9:1: error: stray '\302' in program paritate1.cpp:9:1: error: stray '\240' in program paritate1.cpp:9:1: error: stray '\302' in program paritate1.cpp:9:1: error: stray '\240' in program paritate1.cpp:9:1: error: stray '\302' in program paritate1.cpp:9:1: error: stray '\240' in program paritate1.cpp:9:1: error: stray '\302' in program paritate1.cpp:9:1: error: stray '\240' in program paritate1.cpp:9:1: error: stray '\302' in program paritate1.cpp:9:1: error: stray '\240' in program paritate1.cpp:9:1: error: stray '\302' in program paritate1.cpp:9:1: error: stray '\240' in program paritate1.cpp:10:1: error: stray '\302' in program cin >> v[i]; ^ paritate1.cpp:10:1: error: stray '\240' in program paritate1.cpp:10:1: error: stray '\302' in program paritate1.cpp:10:1: error: stray '\240' in program paritate1.cpp:11:1: error: stray '\302' in program nri = nrp = 0; ^ paritate1.cpp:11:1: error: stray '\240' in program paritate1.cpp:11:1: error: stray '\302' in program paritate1.cpp:11:1: error: stray '\240' in program paritate1.cpp:11:1: error: stray '\302' in program paritate1.cpp:11:1: error: stray '\240' in program paritate1.cpp:11:1: error: stray '\302' in program paritate1.cpp:11:1: error: stray '\240' in program paritate1.cpp:12:1: error: stray '\302' in program for(int i = 1 ; i <= n ; ++i) ^ paritate1.cpp:12:1: error: stray '\240' in program paritate1.cpp:12:1: error: stray '\302' in program paritate1.cpp:12:1: error: stray '\240' in program paritate1.cpp:12:1: error: stray '\302' in program paritate1.cpp:12:1: error: stray '\240' in program paritate1.cpp:12:1: error: stray '\302' in program paritate1.cpp:12:1: error: stray '\240' in program paritate1.cpp:12:1: error: stray '\302' in program paritate1.cpp:12:1: error: stray '\240' in program paritate1.cpp:12:1: error: stray '\302' in program paritate1.cpp:12:1: error: stray '\240' in program paritate1.cpp:12:1: error: stray '\302' in program paritate1.cpp:12:1: error: stray '\240' in program paritate1.cpp:12:1: error: stray '\302' in program paritate1.cpp:12:1: error: stray '\240' in program paritate1.cpp:12:1: error: stray '\302' in program paritate1.cpp:12:1: error: stray '\240' in program paritate1.cpp:13:1: error: stray '\302' in program if(v[i] % 2 == 0) ^ paritate1.cpp:13:1: error: stray '\240' in program paritate1.cpp:13:1: error: stray '\302' in program paritate1.cpp:13:1: error: stray '\240' in program paritate1.cpp:13:1: error: stray '\302' in program paritate1.cpp:13:1: error: stray '\240' in program paritate1.cpp:13:1: error: stray '\302' in program paritate1.cpp:13:1: error: stray '\240' in program paritate1.cpp:14:1: error: stray '\302' in program nrp ++; ^ paritate1.cpp:14:1: error: stray '\240' in program paritate1.cpp:16:1: error: stray '\302' in program nri ++; ^ paritate1.cpp:16:1: error: stray '\240' in program paritate1.cpp:17:1: error: stray '\302' in program if(nrp > nri) ^ paritate1.cpp:17:1: error: stray '\240' in program paritate1.cpp:17:1: error: stray '\302' in program paritate1.cpp:17:1: error: stray '\240' in program paritate1.cpp:18:1: error: stray '\302' in program cout << nrp - nri; ^ paritate1.cpp:18:1: error: stray '\240' in program paritate1.cpp:18:1: error: stray '\302' in program paritate1.cpp:18:1: error: stray '\240' in program paritate1.cpp:18:1: error: stray '\302' in program paritate1.cpp:18:1: error: stray '\240' in program paritate1.cpp:18:1: error: stray '\302' in program paritate1.cpp:18:1: error: stray '\240' in program paritate1.cpp:20:1: error: stray '\302' in program cout << nri - nrp; ^ paritate1.cpp:20:1: error: stray '\240' in program paritate1.cpp:20:1: error: stray '\302' in program paritate1.cpp:20:1: error: stray '\240' in program paritate1.cpp:20:1: error: stray '\302' in program paritate1.cpp:20:1: error: stray '\240' in program paritate1.cpp:20:1: error: stray '\302' in program paritate1.cpp:20:1: error: stray '\240' in program paritate1.cpp:21:1: error: stray '\302' in program return 0; ^ paritate1.cpp:21:1: error: stray '\240' in program paritate1.cpp: In function 'int main()': paritate1.cpp:8:1: error: 'cin' was not declared in this scope cin >> n; ^ paritate1.cpp:18:1: error: 'cout' was not declared in this scope cout << nrp - nri; ^ paritate1.cpp:20:1: error: 'cout' was not declared in this scope cout << nri - nrp; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Paritate1 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ă.