Detalii evaluare #9970753

Rezumat problemă

#425 Viete

Se consideră ecuația de gradul al doilea \(ax^2+bx+c=0\) cu coeficienți întregi și un număr natural n. Să se determine \(S_n=x_1^n+x_2^n\), unde \(x_1\) și \(x_2\) sunt rădăcinile ecuației, folosind relațiile lui Viete.

Detalii

Problema Viete Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #9970753 Utilizator Tataru Cristian (tatarucristian98)
Fișier viete.cpp Dimensiune 489 B
Data încărcării 03 Iulie 2018, 19:04 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

viete.cpp:4:1: error: stray '\302' in program
   int a,b,c,n,S,P,v[11],OK=0,i=3; 

 ^
viete.cpp:4:1: error: stray '\240' in program
viete.cpp:4:1: error: stray '\302' in program
viete.cpp:4:1: error: stray '\240' in program
viete.cpp:5:1: error: stray '\302' in program
   cin>>a>>b>>c>>n; 

 ^
viete.cpp:5:1: error: stray '\240' in program
viete.cpp:6:1: error: stray '\302' in program
   S = (-1)*b; 

 ^
viete.cpp:6:1: error: stray '\240' in program
viete.cpp:6:1: error: stray '\302' in program
viete.cpp:6:1: error: stray '\240' in program
viete.cpp:7:1: error: stray '\302' in program
   P = c; 

 ^
viete.cpp:7:1: error: stray '\240' in program
viete.cpp:7:1: error: stray '\302' in program
viete.cpp:7:1: error: stray '\240' in program
viete.cpp:8:1: error: stray '\302' in program
   switch(n) { 

 ^
viete.cpp:8:1: error: stray '\240' in program
viete.cpp:8:1: error: stray '\302' in program
viete.cpp:8:1: error: stray '\240' in program
viete.cpp:8:1: error: stray '\302' in program
viete.cpp:8:1: error: stray '\240' in program
viete.cpp:9:1: error: stray '\302' in program
     case 1: cout<<S; OK=1; break; 

 ^
viete.cpp:9:1: error: stray '\240' in program
viete.cpp:9:1: error: stray '\302' in program
viete.cpp:9:1: error: stray '\240' in program
viete.cpp:9:1: error: stray '\302' in program
viete.cpp:9:1: error: stray '\240' in program
viete.cpp:10:1: error: stray '\302' in program
     case 2: cout<<S*S - 2*P; OK=1; break; 

 ^
viete.cpp:10:1: error: stray '\240' in program
viete.cpp:10:1: error: stray '\302' in program
viete.cpp:10:1: error: stray '\240' in program
viete.cpp:11:1: error: stray '\302' in program
   } 

 ^
viete.cpp:11:1: error: stray '\240' in program
viete.cpp:12:1: error: stray '\302' in program
   if(!OK) { 

 ^
viete.cpp:12:1: error: stray '\240' in program
viete.cpp:12:1: error: stray '\302' in program
viete.cpp:12:1: error: stray '\240' in program
viete.cpp:13:1: error: stray '\302' in program
     v[1] = S; 

 ^
viete.cpp:13:1: error: stray '\240' in program
viete.cpp:13:1: error: stray '\302' in program
viete.cpp:13:1: error: stray '\240' in program
viete.cpp:13:1: error: stray '\302' in program
viete.cpp:13:1: error: stray '\240' in program
viete.cpp:14:1: error: stray '\302' in program
     v[2] = S*S - 2*P; 

 ^
viete.cpp:14:1: error: stray '\240' in program
viete.cpp:14:1: error: stray '\302' in program
viete.cpp:14:1: error: stray '\240' in program
viete.cpp:14:1: error: stray '\302' in program
viete.cpp:14:1: error: stray '\240' in program
viete.cpp:15:1: error: stray '\302' in program
     while(n!=2) { 

 ^
viete.cpp:15:1: error: stray '\240' in program
viete.cpp:15:1: error: stray '\302' in program
viete.cpp:15:1: error: stray '\240' in program
viete.cpp:15:1: error: stray '\302' in program
viete.cpp:15:1: error: stray '\240' in program
viete.cpp:15:1: error: stray '\302' in program
viete.cpp:15:1: error: stray '\240' in program
viete.cpp:16:1: error: stray '\302' in program
        v[i] = S*v[i-1] - P*v[i-2]; 

 ^
viete.cpp:16:1: error: stray '\240' in program
viete.cpp:16:1: error: stray '\302' in program
viete.cpp:16:1: error: stray '\240' in program
viete.cpp:16:1: error: stray '\302' in program
viete.cpp:16:1: error: stray '\240' in program
viete.cpp:16:1: error: stray '\302' in program
viete.cpp:16:1: error: stray '\240' in program
viete.cpp:17:1: error: stray '\302' in program
        i++; 

 ^
viete.cpp:17:1: error: stray '\240' in program
viete.cpp:17:1: error: stray '\302' in program
viete.cpp:17:1: error: stray '\240' in program
viete.cpp:17:1: error: stray '\302' in program
viete.cpp:17:1: error: stray '\240' in program
viete.cpp:17:1: error: stray '\302' in program
viete.cpp:17:1: error: stray '\240' in program
viete.cpp:18:1: error: stray '\302' in program
        n--; 

 ^
viete.cpp:18:1: error: stray '\240' in program
viete.cpp:18:1: error: stray '\302' in program
viete.cpp:18:1: error: stray '\240' in program
viete.cpp:18:1: error: stray '\302' in program
viete.cpp:18:1: error: stray '\240' in program
viete.cpp:18:1: error: stray '\302' in program
viete.cpp:18:1: error: stray '\240' in program
viete.cpp:19:1: error: stray '\302' in program
      } 

 ^
viete.cpp:19:1: error: stray '\240' in program
viete.cpp:19:1: error: stray '\302' in program
viete.cpp:19:1: error: stray '\240' in program
viete.cpp:19:1: error: stray '\302' in program
viete.cpp:19:1: error: stray '\240' in program
viete.cpp:20:1: error: stray '\302' in program
      cout<<v[i-1]; 

 ^
viete.cpp:20:1: error: stray '\240' in program
viete.cpp:20:1: error: stray '\302' in program
viete.cpp:20:1: error: stray '\240' in program
viete.cpp:20:1: error: stray '\302' in program
viete.cpp:20:1: error: stray '\240' in program
viete.cpp:21:1: error: stray '\302' in program
   } 

 ^
viete.cpp:21:1: error: stray '\240' in program
viete.cpp:21:1: error: stray '\302' in program
viete.cpp:21:1: error: stray '\240' in program
viete.cpp:22:1: error: stray '\302' in program
   return 0; 

 ^
viete.cpp:22: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 Viete 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ă.