#547
Numarare6
Se citește un vector cu n
elemente, numere naturale. Să se determine câte elemente ale vectorului sunt egale cu diferența dintre cea mai mare și cea mai mică valoare din vector.
Problema | Numarare6 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #46811562 | Utilizator | |
Fișier | numarare6.cpp | Dimensiune | 640 B |
Data încărcării | 23 Noiembrie 2023, 15:04 | Scor / rezultat | Eroare de compilare |
numarare6.cpp:4:1: error: expected ',' or ';' before 'ofstream' ofstream fout("clase.out") ^ numarare6.cpp: In function 'int main()': numarare6.cpp:7:7: error: 'n' was not declared in this scope {fin>>n; ^ numarare6.cpp:9:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ numarare6.cpp:11:14: error: 'x' was not declared in this scope fin>>x[i]; ^ numarare6.cpp:13:10: error: 'm' was not declared in this scope fin>>m; ^ numarare6.cpp:15:9: error: 'i' was not declared in this scope for(i=1;i<=m;i++) ^ numarare6.cpp:17:14: error: 'a' was not declared in this scope fin>>a; ^ numarare6.cpp:19:9: error: 'st' was not declared in this scope st=1; dr=n; poz=0; ^ numarare6.cpp:19:15: error: 'dr' was not declared in this scope st=1; dr=n; poz=0; ^ numarare6.cpp:19:21: error: 'poz' was not declared in this scope st=1; dr=n; poz=0; ^ numarare6.cpp:23:13: error: 'mij' was not declared in this scope mij=(st+dr)/2; ^ numarare6.cpp:25:19: error: 'x' was not declared in this scope if(a==x[mij]) ^ numarare6.cpp:37:6: error: 'x' was not declared in this scope if(x[i]==poz)nr++; ^ numarare6.cpp:37:8: error: 'i' was not declared in this scope if(x[i]==poz)nr++; ^ numarare6.cpp:37:12: error: 'poz' was not declared in this scope if(x[i]==poz)nr++; ^ numarare6.cpp:37:16: error: 'nr' was not declared in this scope if(x[i]==poz)nr++; ^ numarare6.cpp:39:5: error: 'cout' was not declared in this scope cout<<nr; ^ numarare6.cpp:39:11: error: 'nr' was not declared in this scope cout<<nr; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numarare6 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ă.