#3081
TruncatableLeft
Un număr prim se numește trunchiabil-stânga
dacă, prin eliminare repetată a primei cifre, toate numerele rezultate sunt prime.
Se dă un număr natural, să se verifice dacă numărul este trunchiabil-stânga
.
Inspirată din Numberphile - 357686312646216567629137
Problema | TruncatableLeft | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #22298229 | Utilizator | |
Fișier | truncatableleft.cpp | Dimensiune | 431 B |
Data încărcării | 02 Aprilie 2020, 17:11 | Scor / rezultat | Eroare de compilare |
truncatableleft.cpp:4:1: error: stray '\302' in program int a, cp, pp=1, ok=1, inv=0, d; ^ truncatableleft.cpp:4:1: error: stray '\240' in program truncatableleft.cpp:5:1: error: stray '\302' in program cin>>a; ^ truncatableleft.cpp:5:1: error: stray '\240' in program truncatableleft.cpp:5:1: error: stray '\302' in program truncatableleft.cpp:5:1: error: stray '\240' in program truncatableleft.cpp:6:1: error: stray '\302' in program cp=a; ^ truncatableleft.cpp:6:1: error: stray '\240' in program truncatableleft.cpp:6:1: error: stray '\302' in program truncatableleft.cpp:6:1: error: stray '\240' in program truncatableleft.cpp:7:1: error: stray '\302' in program while(cp) ^ truncatableleft.cpp:7:1: error: stray '\240' in program truncatableleft.cpp:7:1: error: stray '\302' in program truncatableleft.cpp:7:1: error: stray '\240' in program truncatableleft.cpp:8:1: error: stray '\302' in program { ^ truncatableleft.cpp:8:1: error: stray '\240' in program truncatableleft.cpp:8:1: error: stray '\302' in program truncatableleft.cpp:8:1: error: stray '\240' in program truncatableleft.cpp:9:1: error: stray '\302' in program inv=inv*10+cp%10; ^ truncatableleft.cpp:9:1: error: stray '\240' in program truncatableleft.cpp:9:1: error: stray '\302' in program truncatableleft.cpp:9:1: error: stray '\240' in program truncatableleft.cpp:9:1: error: stray '\302' in program truncatableleft.cpp:9:1: error: stray '\240' in program truncatableleft.cpp:9:1: error: stray '\302' in program truncatableleft.cpp:9:1: error: stray '\240' in program truncatableleft.cpp:10:1: error: stray '\302' in program cp=cp/10; ^ truncatableleft.cpp:10:1: error: stray '\240' in program truncatableleft.cpp:10:1: error: stray '\302' in program truncatableleft.cpp:10:1: error: stray '\240' in program truncatableleft.cpp:10:1: error: stray '\302' in program truncatableleft.cpp:10:1: error: stray '\240' in program truncatableleft.cpp:10:1: error: stray '\302' in program truncatableleft.cpp:10:1: error: stray '\240' in program truncatableleft.cpp:11:1: error: stray '\302' in program } ^ truncatableleft.cpp:11:1: error: stray '\240' in program truncatableleft.cpp:11:1: error: stray '\302' in program truncatableleft.cpp:11:1: error: stray '\240' in program truncatableleft.cpp:12:1: error: stray '\302' in program for(d=2; d<=a/2; d++; ^ truncatableleft.cpp:12:1: error: stray '\240' in program truncatableleft.cpp:12:1: error: stray '\302' in program truncatableleft.cpp:12:1: error: stray '\240' in program truncatableleft.cpp:13:1: error: stray '\302' in program if(a%d==0) ^ truncatableleft.cpp:13:1: error: stray '\240' in program truncatableleft.cpp:13:1: error: stray '\302' in program truncatableleft.cpp:13:1: error: stray '\240' in program truncatableleft.cpp:13:1: error: stray '\302' in program truncatableleft.cpp:13:1: error: stray '\240' in program truncatableleft.cpp:13:1: error: stray '\302' in program truncatableleft.cpp:13:1: error: stray '\240' in program truncatableleft.cpp:14:1: error: stray '\302' in program pp=0; ^ truncatableleft.cpp:14:1: error: stray '\240' in program truncatableleft.cpp:14:1: error: stray '\302' in program truncatableleft.cpp:14:1: error: stray '\240' in program truncatableleft.cpp:14:1: error: stray '\302' in program truncatableleft.cpp:14:1: error: stray '\240' in program truncatableleft.cpp:14:1: error: stray '\302' in program truncatableleft.cpp:14:1: error: stray '\240' in program truncatableleft.cpp:15:1: error: stray '\302' in program for(d=2; d<=inv/2; d++) ^ truncatableleft.cpp:15:1: error: stray '\240' in program truncatableleft.cpp:15:1: error: stray '\302' in program truncatableleft.cpp:15:1: error: stray '\240' in program truncatableleft.cpp:16:1: error: stray '\302' in program if(inv%d==0) ^ truncatableleft.cpp:16:1: error: stray '\240' in program truncatableleft.cpp:16:1: error: stray '\302' in program truncatableleft.cpp:16:1: error: stray '\240' in program truncatableleft.cpp:16:1: error: stray '\302' in program truncatableleft.cpp:16:1: error: stray '\240' in program truncatableleft.cpp:16:1: error: stray '\302' in program truncatableleft.cpp:16:1: error: stray '\240' in program truncatableleft.cpp:17:1: error: stray '\302' in program ok=0; ^ truncatableleft.cpp:17:1: error: stray '\240' in program truncatableleft.cpp:17:1: error: stray '\302' in program truncatableleft.cpp:17:1: error: stray '\240' in program truncatableleft.cpp:17:1: error: stray '\302' in program truncatableleft.cpp:17:1: error: stray '\240' in program truncatableleft.cpp:17:1: error: stray '\302' in program truncatableleft.cpp:17:1: error: stray '\240' in program truncatableleft.cpp:18:1: error: stray '\302' in program if(pp==1 && ok==1) ^ truncatableleft.cpp:18:1: error: stray '\240' in program truncatableleft.cpp:18:1: error: stray '\302' in program truncatableleft.cpp:18:1: error: stray '\240' in program truncatableleft.cpp:18:1: error: stray '\302' in program truncatableleft.cpp:18:1: error: stray '\240' in program truncatableleft.cpp:18:1: error: stray '\302' in program truncatableleft.cpp:18:1: error: stray '\240' in program truncatableleft.cpp:19:1: error: stray '\302' in program cout << "DA"; ^ truncatableleft.cpp:19:1: error: stray '\240' in program truncatableleft.cpp:19:1: error: stray '\302' in program truncatableleft.cpp:19:1: error: stray '\240' in program truncatableleft.cpp:20:1: error: stray '\302' in program else ^ truncatableleft.cpp:20:1: error: stray '\240' in program truncatableleft.cpp:20:1: error: stray '\302' in program truncatableleft.cpp:20:1: error: stray '\240' in program truncatableleft.cpp:21:1: error: stray '\302' in program cout<<"NU"; ^ truncatableleft.cpp:21:1: error: stray '\240' in program truncatableleft.cpp:21:1: error: stray '\302' in program truncatableleft.cpp:21:1: error: stray '\240' in program truncatableleft.cpp:21:1: error: stray '\302' in program truncatableleft.cpp:21:1: error: stray '\240' in program truncatableleft.cpp:21:1: error: stray '\302' in program truncatableleft.cpp:21:1: error: stray '\240' in program truncatableleft.cpp:22:1: error: stray '\302' in program return 0; ^ truncatableleft.cpp:22:1: error: stray '\240' in program truncatableleft.cpp:22:1: error: stray '\302' in program truncatableleft.cpp:22:1: error: stray '\240' in program truncatableleft.cpp: In function 'int main()': truncatableleft.cpp:5:6: error: 'cin' was not declared in this scope cin>>a; ^ truncatableleft.cpp:12:26: error: expected ')' before ';' token for(d=2; d<=a/2; d++; ^ truncatableleft.cpp:19:6: error: 'cout' was not declared in this scope cout << "DA"; ^ truncatableleft.cpp:21:12: error: 'cout' was not declared in this scope cout<<"NU"; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema TruncatableLeft 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ă.