#1828
Inlocuire4
Pentru un număr natural x
mai mare decât 1
numim redusul lui x
cel mai mic număr natural care are exact aceiași divizori primi ca și x
.
Se dă un tablou cu n
elemente, numere naturale mai mari decât 1
. Să se înlocuiască fiecare element din tablou cu redusul său și apoi să afișeze elementele din tabloului ordonate descrescător.
Se vor defini și apela următoarele subprograme:
citire
, care citește de la tastatură valoarea lui n
și cele n
elemente ale tablouluiafisare
, care afișează pe ecran elementele tabloului, separate prin exact un spațiuredus
, care determină pentru un număr dat redusul săusortare
, care sortează descrescător un tablouinloc
, care realizează înlocuirile cerute.În programele C/C++ nu se vor folosi variabile globale.
Problema | Inlocuire4 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #34994262 | Utilizator | |
Fișier | inlocuire4.cpp | Dimensiune | 1.07 KB |
Data încărcării | 22 Februarie 2022, 11:01 | Scor / rezultat | Eroare de compilare |
inlocuire4.cpp:9:1: error: stray '\302' in program int i; ^ inlocuire4.cpp:9:1: error: stray '\240' in program inlocuire4.cpp:9:1: error: stray '\302' in program inlocuire4.cpp:9:1: error: stray '\240' in program inlocuire4.cpp:11:1: error: stray '\302' in program cin >> n; ^ inlocuire4.cpp:11:1: error: stray '\240' in program inlocuire4.cpp:11:1: error: stray '\302' in program inlocuire4.cpp:11:1: error: stray '\240' in program inlocuire4.cpp:13:1: error: stray '\302' in program for (i=0; i<n; ++i) ^ inlocuire4.cpp:13:1: error: stray '\240' in program inlocuire4.cpp:13:1: error: stray '\302' in program inlocuire4.cpp:13:1: error: stray '\240' in program inlocuire4.cpp:15:1: error: stray '\302' in program cin >> v[i]; ^ inlocuire4.cpp:15:1: error: stray '\240' in program inlocuire4.cpp:15:1: error: stray '\302' in program inlocuire4.cpp:15:1: error: stray '\240' in program inlocuire4.cpp:15:1: error: stray '\302' in program inlocuire4.cpp:15:1: error: stray '\240' in program inlocuire4.cpp:15:1: error: stray '\302' in program inlocuire4.cpp:15:1: error: stray '\240' in program inlocuire4.cpp:23:1: error: stray '\302' in program for (int i=0; i<n; ++i) ^ inlocuire4.cpp:23:1: error: stray '\240' in program inlocuire4.cpp:23:1: error: stray '\302' in program inlocuire4.cpp:23:1: error: stray '\240' in program inlocuire4.cpp:25:1: error: stray '\302' in program cout << v[i] << " "; ^ inlocuire4.cpp:25:1: error: stray '\240' in program inlocuire4.cpp:25:1: error: stray '\302' in program inlocuire4.cpp:25:1: error: stray '\240' in program inlocuire4.cpp:25:1: error: stray '\302' in program inlocuire4.cpp:25:1: error: stray '\240' in program inlocuire4.cpp:25:1: error: stray '\302' in program inlocuire4.cpp:25:1: error: stray '\240' in program inlocuire4.cpp:27:1: error: stray '\302' in program cout << "\n"; ^ inlocuire4.cpp:27:1: error: stray '\240' in program inlocuire4.cpp:27:1: error: stray '\302' in program inlocuire4.cpp:27:1: error: stray '\240' in program inlocuire4.cpp:35:1: error: stray '\302' in program int d=2, m=1, p; ^ inlocuire4.cpp:35:1: error: stray '\240' in program inlocuire4.cpp:35:1: error: stray '\302' in program inlocuire4.cpp:35:1: error: stray '\240' in program inlocuire4.cpp:37:1: error: stray '\302' in program while (num!=1) ^ inlocuire4.cpp:37:1: error: stray '\240' in program inlocuire4.cpp:37:1: error: stray '\302' in program inlocuire4.cpp:37:1: error: stray '\240' in program inlocuire4.cpp:39:1: error: stray '\302' in program { ^ inlocuire4.cpp:39:1: error: stray '\240' in program inlocuire4.cpp:39:1: error: stray '\302' in program inlocuire4.cpp:39:1: error: stray '\240' in program inlocuire4.cpp:41:1: error: stray '\302' in program p=0; ^ inlocuire4.cpp:41:1: error: stray '\240' in program inlocuire4.cpp:41:1: error: stray '\302' in program inlocuire4.cpp:41:1: error: stray '\240' in program inlocuire4.cpp:41:1: error: stray '\302' in program inlocuire4.cpp:41:1: error: stray '\240' in program inlocuire4.cpp:41:1: error: stray '\302' in program inlocuire4.cpp:41:1: error: stray '\240' in program inlocuire4.cpp:43:1: error: stray '\302' in program while (num%d==0) ^ inlocuire4.cpp:43:1: error: stray '\240' in program inlocuire4.cpp:43:1: error: stray '\302' in program inlocuire4.cpp:43:1: error: stray '\240' in program inlocuire4.cpp:43:1: error: stray '\302' in program inlocuire4.cpp:43:1: error: stray '\240' in program inlocuire4.cpp:43:1: error: stray '\302' in program inlocuire4.cpp:43:1: error: stray '\240' in program inlocuire4.cpp:45:1: error: stray '\302' in program { ^ inlocuire4.cpp:45:1: error: stray '\240' in program inlocuire4.cpp:45:1: error: stray '\302' in program inlocuire4.cpp:45:1: error: stray '\240' in program inlocuire4.cpp:45:1: error: stray '\302' in program inlocuire4.cpp:45:1: error: stray '\240' in program inlocuire4.cpp:45:1: error: stray '\302' in program inlocuire4.cpp:45:1: error: stray '\240' in program inlocuire4.cpp:47:1: error: stray '\302' in program ++p; num=num/d; ^ inlocuire4.cpp:47:1: error: stray '\240' in program inlocuire4.cpp:47:1: error: stray '\302' in program inlocuire4.cpp:47:1: error: stray '\240' in program inlocuire4.cpp:47:1: error: stray '\302' in program inlocuire4.cpp:47:1: error: stray '\240' in program inlocuire4.cpp:47:1: error: stray '\302' in program inlocuire4.cpp:47:1: error: stray '\240' in program inlocuire4.cpp:47:1: error: stray '\302' in program inlocuire4.cpp:47:1: error: stray '\240' in program inlocuire4.cpp:47:1: error: stray '\302' in program inlocuire4.cpp:47:1: error: stray '\240' in program inlocuire4.cpp:49:1: error: stray '\302' in program } ^ inlocuire4.cpp:49:1: error: stray '\240' in program inlocuire4.cpp:49:1: error: stray '\302' in program inlocuire4.cpp:49:1: error: stray '\240' in program inlocuire4.cpp:49:1: error: stray '\302' in program inlocuire4.cpp:49:1: error: stray '\240' in program inlocuire4.cpp:49:1: error: stray '\302' in program inlocuire4.cpp:49:1: error: stray '\240' in program inlocuire4.cpp:51:1: error: stray '\302' in program if (p) { m=m*d; } ^ inlocuire4.cpp:51:1: error: stray '\240' in program inlocuire4.cpp:51:1: error: stray '\302' in program inlocuire4.cpp:51:1: error: stray '\240' in program inlocuire4.cpp:51:1: error: stray '\302' in program inlocuire4.cpp:51:1: error: stray '\240' in program inlocuire4.cpp:51:1: error: stray '\302' in program inlocuire4.cpp:51:1: error: stray '\240' in program inlocuire4.cpp:53:1: error: stray '\302' in program ++d; ^ inlocuire4.cpp:53:1: error: stray '\240' in program inlocuire4.cpp:53:1: error: stray '\302' in program inlocuire4.cpp:53:1: error: stray '\240' in program inlocuire4.cpp:53:1: error: stray '\302' in program inlocuire4.cpp:53:1: error: stray '\240' in program inlocuire4.cpp:53:1: error: stray '\302' in program inlocuire4.cpp:53:1: error: stray '\240' in program inlocuire4.cpp:55:1: error: stray '\302' in program if (num>1 && d*d>num) d=num; ^ inlocuire4.cpp:55:1: error: stray '\240' in program inlocuire4.cpp:55:1: error: stray '\302' in program inlocuire4.cpp:55:1: error: stray '\240' in program inlocuire4.cpp:55:1: error: stray '\302' in program inlocuire4.cpp:55:1: error: stray '\240' in program inlocuire4.cpp:55:1: error: stray '\302' in program inlocuire4.cpp:55:1: error: stray '\240' in program inlocuire4.cpp:57:1: error: stray '\302' in program } ^ inlocuire4.cpp:57:1: error: stray '\240' in program inlocuire4.cpp:57:1: error: stray '\302' in program inlocuire4.cpp:57:1: error: stray '\240' in program inlocuire4.cpp:59:1: error: stray '\302' in program return m; ^ inlocuire4.cpp:59:1: error: stray '\240' in program inlocuire4.cpp:67:1: error: stray '\302' in program for (int i=0;i<n; ++i) ^ inlocuire4.cpp:67:1: error: stray '\240' in program inlocuire4.cpp:67:1: error: stray '\302' in program inlocuire4.cpp:67:1: error: stray '\240' in program inlocuire4.cpp:69:1: error: stray '\302' in program { ^ inlocuire4.cpp:69:1: error: stray '\240' in program inlocuire4.cpp:69:1: error: stray '\302' in program inlocuire4.cpp:69:1: error: stray '\240' in program inlocuire4.cpp:71:1: error: stray '\302' in program for (int j=i+1; j<n; ++j) ^ inlocuire4.cpp:71:1: error: stray '\240' in program inlocuire4.cpp:71:1: error: stray '\302' in program inlocuire4.cpp:71:1: error: stray '\240' in program inlocuire4.cpp:71:1: error: stray '\302' in program inlocuire4.cpp:71:1: error: stray '\240' in program inlocuire4.cpp:71:1: error: stray '\302' in program inlocuire4.cpp:71:1: error: stray '\240' in program inlocuire4.cpp:73:1: error: stray '\302' in program { ^ inlocuire4.cpp:73:1: error: stray '\240' in program inlocuire4.cpp:73:1: error: stray '\302' in program inlocuire4.cpp:73:1: error: stray '\240' in program inlocuire4.cpp:73:1: error: stray '\302' in program inlocuire4.cpp:73:1: error: stray '\240' in program inlocuire4.cpp:73:1: error: stray '\302' in program inlocuire4.cpp:73:1: error: stray '\240' in program inlocuire4.cpp:75:1: error: stray '\302' in program if (v[j]>v[i]) swap(v[i], v[j]); ^ inlocuire4.cpp:75:1: error: stray '\240' in program inlocuire4.cpp:75:1: error: stray '\302' in program inlocuire4.cpp:75:1: error: stray '\240' in program inlocuire4.cpp:75:1: error: stray '\302' in program inlocuire4.cpp:75:1: error: stray '\240' in program inlocuire4.cpp:75:1: error: stray '\302' in program inlocuire4.cpp:75:1: error: stray '\240' in program inlocuire4.cpp:75:1: error: stray '\302' in program inlocuire4.cpp:75:1: error: stray '\240' in program inlocuire4.cpp:75:1: error: stray '\302' in program inlocuire4.cpp:75:1: error: stray '\240' in program inlocuire4.cpp:77:1: error: stray '\302' in program } ^ inlocuire4.cpp:77:1: error: stray '\240' in program inlocuire4.cpp:77:1: error: stray '\302' in program inlocuire4.cpp:77:1: error: stray '\240' in program inlocuire4.cpp:77:1: error: stray '\302' in program inlocuire4.cpp:77:1: error: stray '\240' in program inlocuire4.cpp:77:1: error: stray '\302' in program inlocuire4.cpp:77:1: error: stray '\240' in program inlocuire4.cpp:79:1: error: stray '\302' in program } ^ inlocuire4.cpp:79:1: error: stray '\240' in program inlocuire4.cpp:79:1: error: stray '\302' in program inlocuire4.cpp:79:1: error: stray '\240' in program inlocuire4.cpp:87:1: error: stray '\302' in program for (int i=0; i<n; ++i) ^ inlocuire4.cpp:87:1: error: stray '\240' in program inlocuire4.cpp:87:1: error: stray '\302' in program inlocuire4.cpp:87:1: error: stray '\240' in program inlocuire4.cpp:89:1: error: stray '\302' in program v[i]=redus(v[i]); ^ inlocuire4.cpp:89:1: error: stray '\240' in program inlocuire4.cpp:89:1: error: stray '\302' in program inlocuire4.cpp:89:1: error: stray '\240' in program inlocuire4.cpp:89:1: error: stray '\302' in program inlocuire4.cpp:89:1: error: stray '\240' in program inlocuire4.cpp:89:1: error: stray '\302' in program inlocuire4.cpp:89:1: error: stray '\240' in program inlocuire4.cpp:97:1: error: stray '\302' in program int n, a[1001]; ^ inlocuire4.cpp:97:1: error: stray '\240' in program inlocuire4.cpp:99:1: error: stray '\302' in program citire(n, a); ^ inlocuire4.cpp:99:1: error: stray '\240' in program inlocuire4.cpp:101:1: error: stray '\302' in program inloc(n, a); ^ inlocuire4.cpp:101:1: error: stray '\240' in program inlocuire4.cpp:103:1: error: stray '\302' in program sortare(n,a); ^ inlocuire4.cpp:103:1: error: stray '\240' in program inlocuire4.cpp:105:1: error: stray '\302' in program afisare(n,a); ^ inlocuire4.cpp:105:1: error: stray '\240' in program
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Inlocuire4 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ă.