#2560
bits
Se dă un număr natural N
. Determinați valoarea unor anumiți biți din reprezentarea sa în baza 2.
Balcaniada de Informatică 2018, ziua de antrenament
Problema | bits | Operații I/O |
bits.in /bits.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 128 MB
/
Stivă 32 MB
|
Id soluție | #15017195 | Utilizator | |
Fișier | bits.cpp | Dimensiune | 483 B |
Data încărcării | 28 Martie 2019, 12:19 | Scor / rezultat | Eroare de compilare |
bits.cpp:6:1: error: stray '\302' in program int i,n,b,length,res=0; ^ bits.cpp:6:1: error: stray '\240' in program bits.cpp:6:1: error: stray '\302' in program bits.cpp:6:1: error: stray '\240' in program bits.cpp:6:1: error: stray '\302' in program bits.cpp:6:1: error: stray '\240' in program bits.cpp:7:1: error: stray '\302' in program double a=3,c=4; ^ bits.cpp:7:1: error: stray '\240' in program bits.cpp:7:1: error: stray '\302' in program bits.cpp:7:1: error: stray '\240' in program bits.cpp:7:1: error: stray '\302' in program bits.cpp:7:1: error: stray '\240' in program bits.cpp:8:1: error: stray '\302' in program cin>>n>>b; ^ bits.cpp:8:1: error: stray '\240' in program bits.cpp:8:1: error: stray '\302' in program bits.cpp:8:1: error: stray '\240' in program bits.cpp:8:1: error: stray '\302' in program bits.cpp:8:1: error: stray '\240' in program bits.cpp:9:1: error: stray '\302' in program int temp=n; ^ bits.cpp:9:1: error: stray '\240' in program bits.cpp:9:1: error: stray '\302' in program bits.cpp:9:1: error: stray '\240' in program bits.cpp:9:1: error: stray '\302' in program bits.cpp:9:1: error: stray '\240' in program bits.cpp:10:1: error: stray '\302' in program length=0; ^ bits.cpp:10:1: error: stray '\240' in program bits.cpp:10:1: error: stray '\302' in program bits.cpp:10:1: error: stray '\240' in program bits.cpp:10:1: error: stray '\302' in program bits.cpp:10:1: error: stray '\240' in program bits.cpp:11:1: error: stray '\302' in program ^ bits.cpp:11:1: error: stray '\240' in program bits.cpp:11:1: error: stray '\302' in program bits.cpp:11:1: error: stray '\240' in program bits.cpp:11:1: error: stray '\302' in program bits.cpp:11:1: error: stray '\240' in program bits.cpp:12:1: error: stray '\302' in program while(temp>0){ ^ bits.cpp:12:1: error: stray '\240' in program bits.cpp:12:1: error: stray '\302' in program bits.cpp:12:1: error: stray '\240' in program bits.cpp:12:1: error: stray '\302' in program bits.cpp:12:1: error: stray '\240' in program bits.cpp:13:1: error: stray '\302' in program temp=temp/b; ^ bits.cpp:13:1: error: stray '\240' in program bits.cpp:13:1: error: stray '\302' in program bits.cpp:13:1: error: stray '\240' in program bits.cpp:13:1: error: stray '\302' in program bits.cpp:13:1: error: stray '\240' in program bits.cpp:13:1: error: stray '\302' in program bits.cpp:13:1: error: stray '\240' in program bits.cpp:13:1: error: stray '\302' in program bits.cpp:13:1: error: stray '\240' in program bits.cpp:13:1: error: stray '\302' in program bits.cpp:13:1: error: stray '\240' in program bits.cpp:14:1: error: stray '\302' in program length++; ^ bits.cpp:14:1: error: stray '\240' in program bits.cpp:14:1: error: stray '\302' in program bits.cpp:14:1: error: stray '\240' in program bits.cpp:14:1: error: stray '\302' in program bits.cpp:14:1: error: stray '\240' in program bits.cpp:14:1: error: stray '\302' in program bits.cpp:14:1: error: stray '\240' in program bits.cpp:14:1: error: stray '\302' in program bits.cpp:14:1: error: stray '\240' in program bits.cpp:14:1: error: stray '\302' in program bits.cpp:14:1: error: stray '\240' in program bits.cpp:14:1: error: stray '\302' in program bits.cpp:14:1: error: stray '\240' in program bits.cpp:14:1: error: stray '\302' in program bits.cpp:14:1: error: stray '\240' in program bits.cpp:14:1: error: stray '\302' in program bits.cpp:14:1: error: stray '\240' in program bits.cpp:15:1: error: stray '\302' in program } ^ bits.cpp:15:1: error: stray '\240' in program bits.cpp:15:1: error: stray '\302' in program bits.cpp:15:1: error: stray '\240' in program bits.cpp:15:1: error: stray '\302' in program bits.cpp:15:1: error: stray '\240' in program bits.cpp:16:1: error: stray '\302' in program ^ bits.cpp:16:1: error: stray '\240' in program bits.cpp:16:1: error: stray '\302' in program bits.cpp:16:1: error: stray '\240' in program bits.cpp:16:1: error: stray '\302' in program bits.cpp:16:1: error: stray '\240' in program bits.cpp:17:1: error: stray '\302' in program for(i=0;i<length;i++){ ^ bits.cpp:17:1: error: stray '\240' in program bits.cpp:17:1: error: stray '\302' in program bits.cpp:17:1: error: stray '\240' in program bits.cpp:17:1: error: stray '\302' in program bits.cpp:17:1: error: stray '\240' in program bits.cpp:18:1: error: stray '\302' in program ^ bits.cpp:18:1: error: stray '\240' in program bits.cpp:18:1: error: stray '\302' in program bits.cpp:18:1: error: stray '\240' in program bits.cpp:18:1: error: stray '\302' in program bits.cpp:18:1: error: stray '\240' in program bits.cpp:18:1: error: stray '\302' in program bits.cpp:18:1: error: stray '\240' in program bits.cpp:19:1: error: stray '\302' in program res=res*10+(n/pow(b,length-1-i)); ^ bits.cpp:19:1: error: stray '\240' in program bits.cpp:19:1: error: stray '\302' in program bits.cpp:19:1: error: stray '\240' in program bits.cpp:19:1: error: stray '\302' in program bits.cpp:19:1: error: stray '\240' in program bits.cpp:19:1: error: stray '\302' in program bits.cpp:19:1: error: stray '\240' in program bits.cpp:19:1: error: stray '\302' in program bits.cpp:19:1: error: stray '\240' in program bits.cpp:19:1: error: stray '\302' in program bits.cpp:19:1: error: stray '\240' in program bits.cpp:20:1: error: stray '\302' in program n=n%int(pow(b,length-1-i)); ^ bits.cpp:20:1: error: stray '\240' in program bits.cpp:20:1: error: stray '\302' in program bits.cpp:20:1: error: stray '\240' in program bits.cpp:20:1: error: stray '\302' in program bits.cpp:20:1: error: stray '\240' in program bits.cpp:20:1: error: stray '\302' in program bits.cpp:20:1: error: stray '\240' in program bits.cpp:20:1: error: stray '\302' in program bits.cpp:20:1: error: stray '\240' in program bits.cpp:20:1: error: stray '\302' in program bits.cpp:20:1: error: stray '\240' in program bits.cpp:22:1: error: stray '\302' in program ^ bits.cpp:22:1: error: stray '\240' in program bits.cpp:22:1: error: stray '\302' in program bits.cpp:22:1: error: stray '\240' in program bits.cpp:22:1: error: stray '\302' in program bits.cpp:22:1: error: stray '\240' in program bits.cpp:22:1: error: stray '\302' in program bits.cpp:22:1: error: stray '\240' in program bits.cpp:22:1: error: stray '\302' in program bits.cpp:22:1: error: stray '\240' in program bits.cpp:22:1: error: stray '\302' in program bits.cpp:22:1: error: stray '\240' in program bits.cpp:23:1: error: stray '\302' in program } ^ bits.cpp:23:1: error: stray '\240' in program bits.cpp:23:1: error: stray '\302' in program bits.cpp:23:1: error: stray '\240' in program bits.cpp:23:1: error: stray '\302' in program bits.cpp:23:1: error: stray '\240' in program bits.cpp:24:1: error: stray '\302' in program cout<<res; ^ bits.cpp:24:1: error: stray '\240' in program bits.cpp:24:1: error: stray '\302' in program bits.cpp:24:1: error: stray '\240' in program bits.cpp:24:1: error: stray '\302' in program bits.cpp:24:1: error: stray '\240' in program bits.cpp: In function 'int main()': bits.cpp:7:15: warning: unused variable 'a' [-Wunused-variable] double a=3,c=4; ^ bits.cpp:7:19: warning: unused variable 'c' [-Wunused-variable] double a=3,c=4; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema bits 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ă.