#390
SPFractii
Se dau 4
numere naturale a b c d
, reprezentând fracțiile \(\frac{a}{b}\) și \(\frac{c}{d}\). Calculați suma și produsul celor două fracții, aduse la forma ireductibilă.
Problema | SPFractii | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50619976 | Utilizator | |
Fișier | spfractii.cpp | Dimensiune | 253 B |
Data încărcării | 17 Aprilie 2024, 13:19 | Scor / rezultat | Eroare de compilare |
spfractii.cpp: In function 'int main()': spfractii.cpp:6:17: error: expected ';' after struct definition int n,m;} ^ spfractii.cpp:8:13: error: request for member 'n' in 'f1', which is of non-class type 'int' cin>>f1.n>>f1.m>>f2.n>>f2.m; ^ spfractii.cpp:8:19: error: request for member 'm' in 'f1', which is of non-class type 'int' cin>>f1.n>>f1.m>>f2.n>>f2.m; ^ spfractii.cpp:8:25: error: request for member 'n' in 'f2', which is of non-class type 'int' cin>>f1.n>>f1.m>>f2.n>>f2.m; ^ spfractii.cpp:8:31: error: request for member 'm' in 'f2', which is of non-class type 'int' cin>>f1.n>>f1.m>>f2.n>>f2.m; ^ spfractii.cpp:9:7: error: request for member 'n' in 's', which is of non-class type 'int' s.n=f1.n*f2.m+f1.m*f2.n; ^ spfractii.cpp:9:12: error: request for member 'n' in 'f1', which is of non-class type 'int' s.n=f1.n*f2.m+f1.m*f2.n; ^ spfractii.cpp:9:17: error: request for member 'm' in 'f2', which is of non-class type 'int' s.n=f1.n*f2.m+f1.m*f2.n; ^ spfractii.cpp:9:22: error: request for member 'm' in 'f1', which is of non-class type 'int' s.n=f1.n*f2.m+f1.m*f2.n; ^ spfractii.cpp:9:27: error: request for member 'n' in 'f2', which is of non-class type 'int' s.n=f1.n*f2.m+f1.m*f2.n; ^ spfractii.cpp:10:7: error: request for member 'm' in 's', which is of non-class type 'int' s.m=f1.m*f2.m; ^ spfractii.cpp:10:12: error: request for member 'm' in 'f1', which is of non-class type 'int' s.m=f1.m*f2.m; ^ spfractii.cpp:10:17: error: request for member 'm' in 'f2', which is of non-class type 'int' s.m=f1.m*f2.m; ^ spfractii.cpp:11:5: error: 'x' was not declared in this scope x=s.n; ^ spfractii.cpp:11:9: error: request for member 'n' in 's', which is of non-class type 'int' x=s.n; ^ spfractii.cpp:12:5: error: 'y' was not declared in this scope y=s.m; ^ spfractii.cpp:12:9: error: request for member 'm' in 's', which is of non-class type 'int' y=s.m; ^ spfractii.cpp:7:17: warning: unused variable 'p' [-Wunused-variable] int f1,f2,s,p; ^ spfractii.cpp:12:10: error: expected '}' at end of input y=s.m; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SPFractii 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ă.