#985
cifre11
Se dau n
numere naturale și se cer: aflarea celui mai mare număr din șir cu suma cifrelor minimă, aflarea numărului minim cu număr maxim de cifre consecutive în scrierea sa și aflarea cifrei comune cât mai multor numere din șir.
Problema | cifre11 | Operații I/O |
cifre11.in /cifre11.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 4 MB
/
Stivă 1 MB
|
Id soluție | #53637733 | Utilizator | |
Fișier | cifre11.cpp | Dimensiune | 1.66 KB |
Data încărcării | 07 Noiembrie 2024, 08:40 | Scor / rezultat | Eroare de compilare |
cifre11.cpp:8:1: error: expected ',' or ';' before 'int' int n, i, sum, j, x, a, c, vx[11], vtot[11], cif[11], minsum, cifmax, max1, lsecv, nr1, nr2, maxsecv, nr; ^ cifre11.cpp: In function 'int main()': cifre11.cpp:12:12: error: 'n' was not declared in this scope fin >> n; ^ cifre11.cpp:13:5: error: 'minsum' was not declared in this scope minsum=100;maxsecv=0; ^ cifre11.cpp:13:16: error: 'maxsecv' was not declared in this scope minsum=100;maxsecv=0; ^ cifre11.cpp:14:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ cifre11.cpp:16:16: error: 'x' was not declared in this scope fin >> x; ^ cifre11.cpp:17:13: error: 'j' was not declared in this scope for(j=0; j<=9; j++) ^ cifre11.cpp:19:13: error: 'vx' was not declared in this scope vx[j]=0; ^ cifre11.cpp:21:9: error: 'sum' was not declared in this scope sum = 0; ^ cifre11.cpp:22:9: error: 'a' was not declared in this scope a = x; ^ cifre11.cpp:25:13: error: 'c' was not declared in this scope c = x%10; ^ cifre11.cpp:26:13: error: 'vx' was not declared in this scope vx[c] = 1; ^ cifre11.cpp:33:13: error: 'nr' was not declared in this scope nr = a; ^ cifre11.cpp:35:34: error: 'nr' was not declared in this scope else if(sum==minsum && a>nr) ^ cifre11.cpp:39:9: error: 'lsecv' was not declared in this scope lsecv = 0; ^ cifre11.cpp:40:9: error: 'max1' was not declared in this scope max1 = 0; ^ cifre11.cpp:41:13: error: 'j' was not declared in this scope for(j=0; j<=9; j++) ^ cifre11.cpp:43:16: error: 'vx' was not declared in this scope if(vx[j]>0) ^ cifre11.cpp:45:18: error: 'vtot' was not declared in this scope vtot[j]++; ^ cifre11.cpp:60:26: error: 'nr1' was not declared in this scope maxsecv=max1;nr1=a; ^ cifre11.cpp:62:36: error: 'nr1' was not declared in this scope else if(max1==maxsecv && a<nr1) ^ cifre11.cpp:67:9: error: 'i' was not declared in this scope for(i=0;i<=9;i++) ^ cifre11.cpp:69:12: error: 'vtot' was not declared in this scope if(vtot[i]>cifmax) ^ cifre11.cpp:69:20: error: 'cifmax' was not declared in this scope if(vtot[i]>cifmax) ^ cifre11.cpp:72:13: error: 'nr2' was not declared in this scope nr2 = 1; ^ cifre11.cpp:73:13: error: 'cif' was not declared in this scope cif[1] = i; ^ cifre11.cpp:77:13: error: 'nr2' was not declared in this scope nr2++; ^ cifre11.cpp:78:13: error: 'cif' was not declared in this scope cif[nr2] = i; ^ cifre11.cpp:81:5: error: 'cout' was not declared in this scope cout << nr << endl; ^ cifre11.cpp:81:13: error: 'nr' was not declared in this scope cout << nr << endl; ^ cifre11.cpp:82:13: error: 'nr1' was not declared in this scope cout << nr1 << endl; ^ cifre11.cpp:83:9: error: 'i' was not declared in this scope for(i=1;i<=nr2;i++) ^ cifre11.cpp:83:16: error: 'nr2' was not declared in this scope for(i=1;i<=nr2;i++) ^ cifre11.cpp:85:17: error: 'cif' was not declared in this scope fout << cif[i] << " "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cifre11 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ă.