#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.
Problema | Viete | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #9970751 | Utilizator | |
Fișier | viete.cpp | Dimensiune | 564 B |
Data încărcării | 03 Iulie 2018, 19:03 | Scor / rezultat | Eroare de 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 viete.cpp:25:1: error: stray '\310' in program Citește mai multe pe Brainly.ro - https://brainly.ro/tema/2333694#readmore ^ viete.cpp:25:1: error: stray '\231' in program viete.cpp:25:1: error: 'Cite' does not name a type
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Viete 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ă.