#1981
DivizoriSir
Se dă următorul șir de numere naturale:
1, 3, 9, 25, 65, 161, 385, 897, 2049, 4609, 10241, 22529, 49153, 106497…
Pentru un număr natural n
, citit de la tastatură, afișati numărul de divizori pentru fiecare dintre primii n
termeni din șir.
Problema | DivizoriSir | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0.1 MB
|
Id soluție | #54046889 | Utilizator | |
Fișier | divizorisir.cpp | Dimensiune | 1.52 KB |
Data încărcării | 18 Noiembrie 2024, 17:44 | Scor / rezultat | Eroare de compilare |
divizorisir.cpp:8:11: error: stray '#' in program int numara#include <iostream> ^ divizorisir.cpp:8:12: error: expected initializer before 'include' int numara#include <iostream> ^ divizorisir.cpp:11:24: error: redefinition of 'long long unsigned int n' unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:4:24: error: 'long long unsigned int n' previously declared here unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:11:26: error: redefinition of 'long long unsigned int x' unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:4:26: error: 'long long unsigned int x' previously declared here unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:11:28: error: redefinition of 'long long unsigned int pow' unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:4:28: error: 'long long unsigned int pow' previously declared here unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:11:32: error: redefinition of 'long long unsigned int nr' unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:4:32: error: 'long long unsigned int nr' previously declared here unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:11:35: error: redefinition of 'long long unsigned int k' unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:4:35: error: 'long long unsigned int k' previously defined here unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:11:39: error: redefinition of 'long long unsigned int d' unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:4:39: error: 'long long unsigned int d' previously defined here unsigned long long int n,x,pow,nr,k=1,d=2; ^ divizorisir.cpp:13:27: error: redefinition of 'long long unsigned int pow2 [61]' unsigned long long pow2[61]; ^ divizorisir.cpp:6:20: error: 'long long unsigned int pow2 [61]' previously declared here unsigned long long pow2[61]; ^ divizorisir.cpp: In function 'int main()': divizorisir.cpp:38:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=1; i<n; i++) ^ divizorisir.cpp:40:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<n; i++) ^ divizorisir.cpp:42:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<n; i++) ^ divizorisir.cpp:44:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<n; i++) ^ divizorisir.cpp: At global scope: divizorisir.cpp:46:33: error: ISO C++ forbids declaration of '_divizori' with no type [-fpermissive] }_divizori(unsigned long long x) /// Calculez numarul nrd de divizori ai lui x ^ divizorisir.cpp: In function 'int main()': divizorisir.cpp:65:5: error: redefinition of 'int main()' int main() ^ divizorisir.cpp:34:5: error: 'int main()' previously defined here int main() ^ divizorisir.cpp:69:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=1; i<n; i++) ^ divizorisir.cpp:71:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<n; i++) ^ divizorisir.cpp:73:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<n; i++) ^ divizorisir.cpp:75:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<n; i++) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DivizoriSir 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ă.