#1307
Siruri1
Se citeşte un şir X
de numere naturale cu n
elemente. Scrieţi un program care determină şirul Y
de numere prime distincte, care figurează la puterea întâi în cel puţin o descompunere ȋn factori primi a unui număr din șirul X
. Dacă niciun element al şirului X
nu are un factor prim la puterea întâi, atunci se va tipări mesajul Sirul Y e vid.
Problema | Siruri1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52973461 | Utilizator | |
Fișier | siruri1.cpp | Dimensiune | 1.06 KB |
Data încărcării | 14 Octombrie 2024, 17:16 | Scor / rezultat | Eroare de compilare |
siruri1.cpp:3:20: error: 'x' has not been declared void citsir(int n, x) ^ siruri1.cpp: In function 'void citsir(int, int)': siruri1.cpp:8:14: error: 'x' was not declared in this scope cin>>x[i]; ^ siruri1.cpp: At global scope: siruri1.cpp:11:20: error: 'x' has not been declared void tipsir(int n, x) ^ siruri1.cpp: In function 'void tipsir(int, int)': siruri1.cpp:14:15: error: 'x' was not declared in this scope cout<<x[i]<<" "; ^ siruri1.cpp: In function 'void grnnr(int)': siruri1.cpp:20:12: error: invalid types 'int[int]' for array subscript a[i]=1; ^ siruri1.cpp:21:8: error: invalid types 'int[int]' for array subscript a[0]=a[1]=0; ^ siruri1.cpp:21:13: error: invalid types 'int[int]' for array subscript a[0]=a[1]=0; ^ siruri1.cpp:23:15: error: invalid types 'int[int]' for array subscript if(a[i]==1) ^ siruri1.cpp:25:22: error: invalid types 'int[int]' for array subscript a[i*j]=0; ^ siruri1.cpp: At global scope: siruri1.cpp:27:18: error: 'd' has not been declared void put1(int n, d) ^ siruri1.cpp: In function 'void put1(int, int)': siruri1.cpp:31:13: error: 'd' was not declared in this scope while(n%d==0) ^ siruri1.cpp:33:15: error: return-statement with a value, in function returning 'void' [-fpermissive] return p==1; ^ siruri1.cpp: At global scope: siruri1.cpp:35:22: error: 'x' has not been declared void constsir(int n, x, y, z) ^ siruri1.cpp:35:25: error: 'y' has not been declared void constsir(int n, x, y, z) ^ siruri1.cpp:35:28: error: 'z' has not been declared void constsir(int n, x, y, z) ^ siruri1.cpp: In function 'void constsir(int, int, int, int)': siruri1.cpp:37:5: error: 'y' was not declared in this scope y=0; ^ siruri1.cpp:39:12: error: 'a' was not declared in this scope if(a[i]==1) ^ siruri1.cpp:43:25: error: 'x' was not declared in this scope if(put1(x[j] ,i)) ^ siruri1.cpp:46:17: error: 'z' was not declared in this scope z[++y]=i; ^ siruri1.cpp: In function 'int main()': siruri1.cpp:52:16: error: invalid conversion from 'int*' to 'int' [-fpermissive] citsir(n, x); ^ siruri1.cpp:3:6: error: initializing argument 2 of 'void citsir(int, int)' [-fpermissive] void citsir(int n, x) ^ siruri1.cpp:53:11: error: 'v' was not declared in this scope grnnr(v); ^ siruri1.cpp:54:23: error: invalid conversion from 'int*' to 'int' [-fpermissive] constsir(n, x,m ,y); ^ siruri1.cpp:35:6: error: initializing argument 2 of 'void constsir(int, int, int, int)' [-fpermissive] void constsir(int n, x, y, z) ^ siruri1.cpp:54:23: error: invalid conversion from 'int*' to 'int' [-fpermissive] constsir(n, x,m ,y); ^ siruri1.cpp:35:6: error: initializing argument 4 of 'void constsir(int, int, int, int)' [-fpermissive] void constsir(int n, x, y, z) ^ siruri1.cpp:56:20: error: invalid conversion from 'int*' to 'int' [-fpermissive] tipsir(m, y); ^ siruri1.cpp:11:6: error: initializing argument 2 of 'void tipsir(int, int)' [-fpermissive] void tipsir(int n, x) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Siruri1 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ă.