Detalii evaluare #34994262

Rezumat problemă

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 tabloului
  • afisare, care afișează pe ecran elementele tabloului, separate prin exact un spațiu
  • redus, care determină pentru un număr dat redusul său
  • sortare, care sortează descrescător un tablou
  • inloc, care realizează înlocuirile cerute.

În programele C/C++ nu se vor folosi variabile globale.

Detalii

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 Preda Carla (carlapreda)
Fișier inlocuire4.cpp Dimensiune 1.07 KB
Data încărcării 22 Februarie 2022, 11:01 Scor / rezultat Eroare de compilare

Evaluare


Mesaj 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

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema Inlocuire4 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.