#525
Se dau n
numere naturale. Determinaţi cele mai mari două numere cu trei cifre care nu apar printre numerele date.
Problema | Numere1 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57789613 | Utilizator | |
Fișier | numere1.cpp | Dimensiune | 354 B |
Data încărcării | 16 Aprilie 2025, 13:33 | Scor / rezultat | Eroare de compilare |
numere1.cpp:4:1: error: stray '\342' in program { int n,x,i,a,b; scanf(“%d”,&n); for(i=1;i<=n;i++) { scanf(“%d”,&x); if(x>=x && x<=999) ap[x]=1; ^ numere1.cpp:4:1: error: stray '\200' in program numere1.cpp:4:1: error: stray '\234' in program numere1.cpp:4:1: error: stray '\342' in program numere1.cpp:4:1: error: stray '\200' in program numere1.cpp:4:1: error: stray '\235' in program numere1.cpp:4:1: error: stray '\342' in program numere1.cpp:4:1: error: stray '\200' in program numere1.cpp:4:1: error: stray '\234' in program numere1.cpp:4:1: error: stray '\342' in program numere1.cpp:4:1: error: stray '\200' in program numere1.cpp:4:1: error: stray '\235' in program numere1.cpp:5:1: error: stray '\342' in program a=999; while(ap[a]==1 && a>=100) a—; if(a>=100) { b=a-1; while(ap[b]==1 && b>=100) b—; if(b>=100) printf(“%d %d”,a,b); else printf(“NU EXISTA”); ^ numere1.cpp:5:1: error: stray '\200' in program numere1.cpp:5:1: error: stray '\224' in program numere1.cpp:5:1: error: stray '\342' in program numere1.cpp:5:1: error: stray '\200' in program numere1.cpp:5:1: error: stray '\224' in program numere1.cpp:5:1: error: stray '\342' in program numere1.cpp:5:1: error: stray '\200' in program numere1.cpp:5:1: error: stray '\234' in program numere1.cpp:5:1: error: stray '\342' in program numere1.cpp:5:1: error: stray '\200' in program numere1.cpp:5:1: error: stray '\235' in program numere1.cpp:5:1: error: stray '\342' in program numere1.cpp:5:1: error: stray '\200' in program numere1.cpp:5:1: error: stray '\234' in program numere1.cpp:5:1: error: stray '\342' in program numere1.cpp:5:1: error: stray '\200' in program numere1.cpp:5:1: error: stray '\235' in program numere1.cpp:6:1: error: stray '\342' in program } else printf(“NU EXISTA”); return 0; ^ numere1.cpp:6:1: error: stray '\200' in program numere1.cpp:6:1: error: stray '\234' in program numere1.cpp:6:1: error: stray '\342' in program numere1.cpp:6:1: error: stray '\200' in program numere1.cpp:6:1: error: stray '\235' in program numere1.cpp: In function 'int main()': numere1.cpp:4:27: error: expected primary-expression before '%' token { int n,x,i,a,b; scanf(“%d”,&n); for(i=1;i<=n;i++) { scanf(“%d”,&x); if(x>=x && x<=999) ap[x]=1; ^ numere1.cpp:4:28: error: 'd' was not declared in this scope { int n,x,i,a,b; scanf(“%d”,&n); for(i=1;i<=n;i++) { scanf(“%d”,&x); if(x>=x && x<=999) ap[x]=1; ^ numere1.cpp:4:67: error: expected primary-expression before '%' token { int n,x,i,a,b; scanf(“%d”,&n); for(i=1;i<=n;i++) { scanf(“%d”,&x); if(x>=x && x<=999) ap[x]=1; ^ numere1.cpp:4:97: error: 'ap' was not declared in this scope { int n,x,i,a,b; scanf(“%d”,&n); for(i=1;i<=n;i++) { scanf(“%d”,&x); if(x>=x && x<=999) ap[x]=1; ^ numere1.cpp:5:14: error: 'ap' was not declared in this scope a=999; while(ap[a]==1 && a>=100) a—; if(a>=100) { b=a-1; while(ap[b]==1 && b>=100) b—; if(b>=100) printf(“%d %d”,a,b); else printf(“NU EXISTA”); ^ numere1.cpp:5:38: warning: statement has no effect [-Wunused-value] a=999; while(ap[a]==1 && a>=100) a—; if(a>=100) { b=a-1; while(ap[b]==1 && b>=100) b—; if(b>=100) printf(“%d %d”,a,b); else printf(“NU EXISTA”); ^ numere1.cpp:5:66: error: 'ap' was not declared in this scope a=999; while(ap[a]==1 && a>=100) a—; if(a>=100) { b=a-1; while(ap[b]==1 && b>=100) b—; if(b>=100) printf(“%d %d”,a,b); else printf(“NU EXISTA”); ^ numere1.cpp:5:90: warning: statement has no effect [-Wunused-value] a=999; while(ap[a]==1 && a>=100) a—; if(a>=100) { b=a-1; while(ap[b]==1 && b>=100) b—; if(b>=100) printf(“%d %d”,a,b); else printf(“NU EXISTA”); ^ numere1.cpp:5:113: error: expected primary-expression before '%' token a=999; while(ap[a]==1 && a>=100) a—; if(a>=100) { b=a-1; while(ap[b]==1 && b>=100) b—; if(b>=100) printf(“%d %d”,a,b); else printf(“NU EXISTA”); ^ numere1.cpp:5:143: error: 'NU' was not declared in this scope a=999; while(ap[a]==1 && a>=100) a—; if(a>=100) { b=a-1; while(ap[b]==1 && b>=100) b—; if(b>=100) printf(“%d %d”,a,b); else printf(“NU EXISTA”); ^ numere1.cpp:6:18: error: 'NU' was not declared in this scope } else printf(“NU EXISTA”); return 0; ^ numere1.cpp:7:1: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numere1 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ă.