#389
DivizoriPariInterval
Se citesc două numere naturale a
și b
. Să se determine cel mai mic și cel mai mare număr din intervalul [a,b]
cu număr maxim de divizori pari şi numărul maxim de divizori pari.
Problema | DivizoriPariInterval | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54586954 | Utilizator | |
Fișier | divizoripariinterval.cpp | Dimensiune | 488 B |
Data încărcării | 03 Decembrie 2024, 09:31 | Scor / rezultat | Eroare de compilare |
divizoripariinterval.cpp:16:14: error: empty character constant cout<<maxi<<''<<s<<''<<n; ^ divizoripariinterval.cpp:16:21: error: empty character constant cout<<maxi<<''<<s<<''<<n; ^ divizoripariinterval.cpp: In function 'int main()': divizoripariinterval.cpp:4:8: error: expected initializer before '.' token { int a.b,i,maxi=0,d,k,s,n; ^ divizoripariinterval.cpp:5:7: error: 'a' was not declared in this scope cin>>a>>b; ^ divizoripariinterval.cpp:5:10: error: 'b' was not declared in this scope cin>>a>>b; ^ divizoripariinterval.cpp:6:6: error: 'i' was not declared in this scope for(i=a;i<=b;i++){if(i%2==0)k=1; ^ divizoripariinterval.cpp:6:30: error: 'k' was not declared in this scope for(i=a;i<=b;i++){if(i%2==0)k=1; ^ divizoripariinterval.cpp:7:8: error: 'k' was not declared in this scope else k=0; ^ divizoripariinterval.cpp:8:24: error: 'd' was not declared in this scope for(d=2;d*d<=i;d++) ^ divizoripariinterval.cpp:10:33: error: 'k' was not declared in this scope {if (d%2==0) k++; ^ divizoripariinterval.cpp:12:39: error: 'k' was not declared in this scope { if ((1/d)%2==0) k++;}}} ^ divizoripariinterval.cpp:13:24: error: 'k' was not declared in this scope if (k>maxi) ^ divizoripariinterval.cpp:13:26: error: 'maxi' was not declared in this scope if (k>maxi) ^ divizoripariinterval.cpp:14:29: error: 's' was not declared in this scope {maxi=k; s=i, n=i;} ^ divizoripariinterval.cpp:14:34: error: 'n' was not declared in this scope {maxi=k; s=i, n=i;} ^ divizoripariinterval.cpp:15:37: error: 'n' was not declared in this scope else if (k=maxi) n=i;} ^ divizoripariinterval.cpp:16:8: error: 'maxi' was not declared in this scope cout<<maxi<<''<<s<<''<<n; ^ divizoripariinterval.cpp:16:18: error: 's' was not declared in this scope cout<<maxi<<''<<s<<''<<n; ^ divizoripariinterval.cpp:16:25: error: 'n' was not declared in this scope cout<<maxi<<''<<s<<''<<n; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DivizoriPariInterval 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ă.