#2642
phi
C++
Să se scrie funcția cu următorul antet:
int Phi(int n)
Funcția primește ca parametru un număr natural n
și trebuie să returneze numărul de numere naturale nenule prime cu n
și strict mai mici decât n
.
Folclorul informatic
Problema | phi | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #23306770 | Utilizator | |
Fișier | phi.cpp | Dimensiune | 332 B |
Data încărcării | 13 Iunie 2020, 15:28 | Scor / rezultat | Eroare de compilare |
phi.cpp:8:1: error: stray '\302' in program register int nr=1,d=2,p; ^ phi.cpp:8:1: error: stray '\240' in program phi.cpp:8:1: error: stray '\302' in program phi.cpp:8:1: error: stray '\240' in program phi.cpp:10:1: error: stray '\302' in program while(n>1) ^ phi.cpp:10:1: error: stray '\240' in program phi.cpp:10:1: error: stray '\302' in program phi.cpp:10:1: error: stray '\240' in program phi.cpp:12:1: error: stray '\302' in program { ^ phi.cpp:12:1: error: stray '\240' in program phi.cpp:12:1: error: stray '\302' in program phi.cpp:12:1: error: stray '\240' in program phi.cpp:14:1: error: stray '\302' in program p=0; ^ phi.cpp:14:1: error: stray '\240' in program phi.cpp:14:1: error: stray '\302' in program phi.cpp:14:1: error: stray '\240' in program phi.cpp:14:1: error: stray '\302' in program phi.cpp:14:1: error: stray '\240' in program phi.cpp:14:1: error: stray '\302' in program phi.cpp:14:1: error: stray '\240' in program phi.cpp:16:1: error: stray '\302' in program while(n%d==0) ^ phi.cpp:16:1: error: stray '\240' in program phi.cpp:16:1: error: stray '\302' in program phi.cpp:16:1: error: stray '\240' in program phi.cpp:16:1: error: stray '\302' in program phi.cpp:16:1: error: stray '\240' in program phi.cpp:16:1: error: stray '\302' in program phi.cpp:16:1: error: stray '\240' in program phi.cpp:18:1: error: stray '\302' in program ++p,n/=d; ^ phi.cpp:18:1: error: stray '\240' in program phi.cpp:18:1: error: stray '\302' in program phi.cpp:18:1: error: stray '\240' in program phi.cpp:18:1: error: stray '\302' in program phi.cpp:18:1: error: stray '\240' in program phi.cpp:18:1: error: stray '\302' in program phi.cpp:18:1: error: stray '\240' in program phi.cpp:18:1: error: stray '\302' in program phi.cpp:18:1: error: stray '\240' in program phi.cpp:18:1: error: stray '\302' in program phi.cpp:18:1: error: stray '\240' in program phi.cpp:20:1: error: stray '\302' in program if(p) ^ phi.cpp:20:1: error: stray '\240' in program phi.cpp:20:1: error: stray '\302' in program phi.cpp:20:1: error: stray '\240' in program phi.cpp:20:1: error: stray '\302' in program phi.cpp:20:1: error: stray '\240' in program phi.cpp:20:1: error: stray '\302' in program phi.cpp:20:1: error: stray '\240' in program phi.cpp:22:1: error: stray '\302' in program nr*=(d-1)*pow(d,p-1); ^ phi.cpp:22:1: error: stray '\240' in program phi.cpp:22:1: error: stray '\302' in program phi.cpp:22:1: error: stray '\240' in program phi.cpp:22:1: error: stray '\302' in program phi.cpp:22:1: error: stray '\240' in program phi.cpp:22:1: error: stray '\302' in program phi.cpp:22:1: error: stray '\240' in program phi.cpp:22:1: error: stray '\302' in program phi.cpp:22:1: error: stray '\240' in program phi.cpp:22:1: error: stray '\302' in program phi.cpp:22:1: error: stray '\240' in program phi.cpp:24:1: error: stray '\302' in program ++d; ^ phi.cpp:24:1: error: stray '\240' in program phi.cpp:24:1: error: stray '\302' in program phi.cpp:24:1: error: stray '\240' in program phi.cpp:24:1: error: stray '\302' in program phi.cpp:24:1: error: stray '\240' in program phi.cpp:24:1: error: stray '\302' in program phi.cpp:24:1: error: stray '\240' in program phi.cpp:26:1: error: stray '\302' in program if(n>1 && d*d>n) ^ phi.cpp:26:1: error: stray '\240' in program phi.cpp:26:1: error: stray '\302' in program phi.cpp:26:1: error: stray '\240' in program phi.cpp:26:1: error: stray '\302' in program phi.cpp:26:1: error: stray '\240' in program phi.cpp:26:1: error: stray '\302' in program phi.cpp:26:1: error: stray '\240' in program phi.cpp:28:1: error: stray '\302' in program d=n; ^ phi.cpp:28:1: error: stray '\240' in program phi.cpp:28:1: error: stray '\302' in program phi.cpp:28:1: error: stray '\240' in program phi.cpp:28:1: error: stray '\302' in program phi.cpp:28:1: error: stray '\240' in program phi.cpp:28:1: error: stray '\302' in program phi.cpp:28:1: error: stray '\240' in program phi.cpp:28:1: error: stray '\302' in program phi.cpp:28:1: error: stray '\240' in program phi.cpp:28:1: error: stray '\302' in program phi.cpp:28:1: error: stray '\240' in program phi.cpp:30:1: error: stray '\302' in program } ^ phi.cpp:30:1: error: stray '\240' in program phi.cpp:30:1: error: stray '\302' in program phi.cpp:30:1: error: stray '\240' in program phi.cpp:32:1: error: stray '\302' in program return nr; ^ phi.cpp:32:1: error: stray '\240' in program phi.cpp:32:1: error: stray '\302' in program phi.cpp:32:1: error: stray '\240' in program phi.cpp: In function 'int Phi(int)': phi.cpp:22:37: error: 'pow' was not declared in this scope nr*=(d-1)*pow(d,p-1); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema phi face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.