#803
NrSufix
Fiind date două numere a
şi b
, îl numim pe a
sufix al lui b
dacă a
este egal cu b
sau dacă b
se poate obţine din a prin alipirea la stânga a unor noi cifre.
Se dă un număr natural x
și un șir de numere naturale. Să se determine ultimul număr din șir care îl care ca sufix pe x
.
Variante Bacalaureat 2013
Problema | NrSufix | Operații I/O |
nrsufix.in /nrsufix.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
Id soluție | #53199931 | Utilizator | |
Fișier | nrsufix.cpp | Dimensiune | 656 B |
Data încărcării | 21 Octombrie 2024, 10:04 | Scor / rezultat | Eroare de compilare |
nrsufix.cpp:8:1: error: stray '\302' in program // citim un numar n, cautam ultimi nr ^ nrsufix.cpp:8:1: error: stray '\240' in program nrsufix.cpp:8:1: error: stray '\302' in program nrsufix.cpp:8:1: error: stray '\240' in program nrsufix.cpp:9:1: error: stray '\302' in program // care este sufixul lui numarul n ^ nrsufix.cpp:9:1: error: stray '\240' in program nrsufix.cpp:9:1: error: stray '\302' in program nrsufix.cpp:9:1: error: stray '\240' in program nrsufix.cpp:10:1: error: stray '\302' in program // 12 ^ nrsufix.cpp:10:1: error: stray '\240' in program nrsufix.cpp:10:1: error: stray '\302' in program nrsufix.cpp:10:1: error: stray '\240' in program nrsufix.cpp:11:1: error: stray '\302' in program // 145 512 30 12 112 3011 312 100 --> 312 ^ nrsufix.cpp:11:1: error: stray '\240' in program nrsufix.cpp:11:1: error: stray '\302' in program nrsufix.cpp:11:1: error: stray '\240' in program nrsufix.cpp:12:1: error: stray '\302' in program ifstream cin("nrsufix.in"); ^ nrsufix.cpp:12:1: error: stray '\240' in program nrsufix.cpp:12:1: error: stray '\302' in program nrsufix.cpp:12:1: error: stray '\240' in program nrsufix.cpp:13:1: error: stray '\302' in program ofstream cout("nrsufix.out"); ^ nrsufix.cpp:13:1: error: stray '\240' in program nrsufix.cpp:13:1: error: stray '\302' in program nrsufix.cpp:13:1: error: stray '\240' in program nrsufix.cpp:14:1: error: stray '\302' in program ^ nrsufix.cpp:14:1: error: stray '\240' in program nrsufix.cpp:14:1: error: stray '\302' in program nrsufix.cpp:14:1: error: stray '\240' in program nrsufix.cpp:15:1: error: stray '\302' in program int n, a, cn, put=1, ult=-1; ^ nrsufix.cpp:15:1: error: stray '\240' in program nrsufix.cpp:15:1: error: stray '\302' in program nrsufix.cpp:15:1: error: stray '\240' in program nrsufix.cpp:16:1: error: stray '\302' in program cin >> n; ^ nrsufix.cpp:16:1: error: stray '\240' in program nrsufix.cpp:16:1: error: stray '\302' in program nrsufix.cpp:16:1: error: stray '\240' in program nrsufix.cpp:17:1: error: stray '\302' in program cn=n; ^ nrsufix.cpp:17:1: error: stray '\240' in program nrsufix.cpp:17:1: error: stray '\302' in program nrsufix.cpp:17:1: error: stray '\240' in program nrsufix.cpp:18:1: error: stray '\302' in program while(cn>0){ ^ nrsufix.cpp:18:1: error: stray '\240' in program nrsufix.cpp:18:1: error: stray '\302' in program nrsufix.cpp:18:1: error: stray '\240' in program nrsufix.cpp:19:1: error: stray '\302' in program put=put*10; ^ nrsufix.cpp:19:1: error: stray '\240' in program nrsufix.cpp:19:1: error: stray '\302' in program nrsufix.cpp:19:1: error: stray '\240' in program nrsufix.cpp:19:1: error: stray '\302' in program nrsufix.cpp:19:1: error: stray '\240' in program nrsufix.cpp:19:1: error: stray '\302' in program nrsufix.cpp:19:1: error: stray '\240' in program nrsufix.cpp:20:1: error: stray '\302' in program cn=cn/10; ^ nrsufix.cpp:20:1: error: stray '\240' in program nrsufix.cpp:20:1: error: stray '\302' in program nrsufix.cpp:20:1: error: stray '\240' in program nrsufix.cpp:20:1: error: stray '\302' in program nrsufix.cpp:20:1: error: stray '\240' in program nrsufix.cpp:20:1: error: stray '\302' in program nrsufix.cpp:20:1: error: stray '\240' in program nrsufix.cpp:21:1: error: stray '\302' in program } ^ nrsufix.cpp:21:1: error: stray '\240' in program nrsufix.cpp:21:1: error: stray '\302' in program nrsufix.cpp:21:1: error: stray '\240' in program nrsufix.cpp:22:1: error: stray '\302' in program while(cin >> a){ ^ nrsufix.cpp:22:1: error: stray '\240' in program nrsufix.cpp:22:1: error: stray '\302' in program nrsufix.cpp:22:1: error: stray '\240' in program nrsufix.cpp:23:1: error: stray '\302' in program if(a%put==n) ^ nrsufix.cpp:23:1: error: stray '\240' in program nrsufix.cpp:23:1: error: stray '\302' in program nrsufix.cpp:23:1: error: stray '\240' in program nrsufix.cpp:23:1: error: stray '\302' in program nrsufix.cpp:23:1: error: stray '\240' in program nrsufix.cpp:23:1: error: stray '\302' in program nrsufix.cpp:23:1: error: stray '\240' in program nrsufix.cpp:24:1: error: stray '\302' in program ult=a; ^ nrsufix.cpp:24:1: error: stray '\240' in program nrsufix.cpp:24:1: error: stray '\302' in program nrsufix.cpp:24:1: error: stray '\240' in program nrsufix.cpp:24:1: error: stray '\302' in program nrsufix.cpp:24:1: error: stray '\240' in program nrsufix.cpp:24:1: error: stray '\302' in program nrsufix.cpp:24:1: error: stray '\240' in program nrsufix.cpp:25:1: error: stray '\302' in program } ^ nrsufix.cpp:25:1: error: stray '\240' in program nrsufix.cpp:25:1: error: stray '\302' in program nrsufix.cpp:25:1: error: stray '\240' in program nrsufix.cpp:26:1: error: stray '\302' in program if(ult==-1){ ^ nrsufix.cpp:26:1: error: stray '\240' in program nrsufix.cpp:26:1: error: stray '\302' in program nrsufix.cpp:26:1: error: stray '\240' in program nrsufix.cpp:27:1: error: stray '\302' in program cout << "nu exista"; ^ nrsufix.cpp:27:1: error: stray '\240' in program nrsufix.cpp:27:1: error: stray '\302' in program nrsufix.cpp:27:1: error: stray '\240' in program nrsufix.cpp:27:1: error: stray '\302' in program nrsufix.cpp:27:1: error: stray '\240' in program nrsufix.cpp:27:1: error: stray '\302' in program nrsufix.cpp:27:1: error: stray '\240' in program nrsufix.cpp:28:1: error: stray '\302' in program } ^ nrsufix.cpp:28:1: error: stray '\240' in program nrsufix.cpp:28:1: error: stray '\302' in program nrsufix.cpp:28:1: error: stray '\240' in program nrsufix.cpp:29:1: error: stray '\302' in program else ^ nrsufix.cpp:29:1: error: stray '\240' in program nrsufix.cpp:29:1: error: stray '\302' in program nrsufix.cpp:29:1: error: stray '\240' in program nrsufix.cpp:30:1: error: stray '\302' in program cout << ult; ^ nrsufix.cpp:30:1: error: stray '\240' in program nrsufix.cpp:30:1: error: stray '\302' in program nrsufix.cpp:30:1: error: stray '\240' in program nrsufix.cpp:31:1: error: stray '\302' in program ^ nrsufix.cpp:31:1: error: stray '\240' in program nrsufix.cpp:31:1: error: stray '\302' in program nrsufix.cpp:31:1: error: stray '\240' in program nrsufix.cpp:33:1: error: stray '\302' in program return 0; ^ nrsufix.cpp:33:1: error: stray '\240' in program nrsufix.cpp:33:1: error: stray '\302' in program nrsufix.cpp:33:1: error: stray '\240' in program
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrSufix 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ă.