Detalii evaluare #54802731

Rezumat problemă

Se dau trei numere naturale n a b, 1 ≤ a < b < n. Să se determine o modalitate de a-l scrie pe n ca sumă de termeni egali cu a sau b în care numărul de termeni egali cu a este minim.

Detalii

Problema PartitieAB1 Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #54802731 Utilizator Zimbroianu Daria Maria (drisaqv)
Fișier partitieab1.cpp Dimensiune 323 B
Data încărcării 09 Decembrie 2024, 10:37 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

partitieab1.cpp:7:1: error: stray '\302' in program
     int n,a,b,na=0,nb=0;

 ^
partitieab1.cpp:7:1: error: stray '\240' in program
partitieab1.cpp:7:1: error: stray '\302' in program
partitieab1.cpp:7:1: error: stray '\240' in program
partitieab1.cpp:8:1: error: stray '\302' in program
     cin>>n>>a>>b;

 ^
partitieab1.cpp:8:1: error: stray '\240' in program
partitieab1.cpp:8:1: error: stray '\302' in program
partitieab1.cpp:8:1: error: stray '\240' in program
partitieab1.cpp:9:1: error: stray '\302' in program
     while(n%b!=0)

 ^
partitieab1.cpp:9:1: error: stray '\240' in program
partitieab1.cpp:9:1: error: stray '\302' in program
partitieab1.cpp:9:1: error: stray '\240' in program
partitieab1.cpp:10:1: error: stray '\302' in program
     {

 ^
partitieab1.cpp:10:1: error: stray '\240' in program
partitieab1.cpp:10:1: error: stray '\302' in program
partitieab1.cpp:10:1: error: stray '\240' in program
partitieab1.cpp:11:1: error: stray '\302' in program
         na++;

 ^
partitieab1.cpp:11:1: error: stray '\240' in program
partitieab1.cpp:11:1: error: stray '\302' in program
partitieab1.cpp:11:1: error: stray '\240' in program
partitieab1.cpp:11:1: error: stray '\302' in program
partitieab1.cpp:11:1: error: stray '\240' in program
partitieab1.cpp:11:1: error: stray '\302' in program
partitieab1.cpp:11:1: error: stray '\240' in program
partitieab1.cpp:12:1: error: stray '\302' in program
         n=n-a;

 ^
partitieab1.cpp:12:1: error: stray '\240' in program
partitieab1.cpp:12:1: error: stray '\302' in program
partitieab1.cpp:12:1: error: stray '\240' in program
partitieab1.cpp:12:1: error: stray '\302' in program
partitieab1.cpp:12:1: error: stray '\240' in program
partitieab1.cpp:12:1: error: stray '\302' in program
partitieab1.cpp:12:1: error: stray '\240' in program
partitieab1.cpp:13:1: error: stray '\302' in program
     }

 ^
partitieab1.cpp:13:1: error: stray '\240' in program
partitieab1.cpp:13:1: error: stray '\302' in program
partitieab1.cpp:13:1: error: stray '\240' in program
partitieab1.cpp:14:1: error: stray '\302' in program
     nb=n/b;

 ^
partitieab1.cpp:14:1: error: stray '\240' in program
partitieab1.cpp:14:1: error: stray '\302' in program
partitieab1.cpp:14:1: error: stray '\240' in program
partitieab1.cpp:15:1: error: stray '\302' in program
     for(int i=1; i<=na; i++)

 ^
partitieab1.cpp:15:1: error: stray '\240' in program
partitieab1.cpp:15:1: error: stray '\302' in program
partitieab1.cpp:15:1: error: stray '\240' in program
partitieab1.cpp:16:1: error: stray '\302' in program
         cout<<a<<" ";

 ^
partitieab1.cpp:16:1: error: stray '\240' in program
partitieab1.cpp:16:1: error: stray '\302' in program
partitieab1.cpp:16:1: error: stray '\240' in program
partitieab1.cpp:16:1: error: stray '\302' in program
partitieab1.cpp:16:1: error: stray '\240' in program
partitieab1.cpp:16:1: error: stray '\302' in program
partitieab1.cpp:16:1: error: stray '\240' in program
partitieab1.cpp:17:1: error: stray '\302' in program
     for(int i=1; i<=nb; i++)

 ^
partitieab1.cpp:17:1: error: stray '\240' in program
partitieab1.cpp:17:1: error: stray '\302' in program
partitieab1.cpp:17:1: error: stray '\240' in program
partitieab1.cpp:18:1: error: stray '\302' in program
         cout<<b<<" ";

 ^
partitieab1.cpp:18:1: error: stray '\240' in program
partitieab1.cpp:18:1: error: stray '\302' in program
partitieab1.cpp:18:1: error: stray '\240' in program
partitieab1.cpp:18:1: error: stray '\302' in program
partitieab1.cpp:18:1: error: stray '\240' in program
partitieab1.cpp:18:1: error: stray '\302' in program
partitieab1.cpp:18: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 PartitieAB1 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ă.