Detalii evaluare #15808939

Rezumat problemă

#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

Detalii

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 #15808939 Utilizator Mogia Alexandru (Mogia)
Fișier bits.cpp Dimensiune 722 B
Data încărcării 14 Mai 2019, 08:00 Scor / rezultat Eroare de compilare

Evaluare


Mesaj 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
     //determina lungimea numarului in baza b

 ^
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
     //vazand care este cel mai mare exponent

 ^
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
     while(temp>0){

 ^
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
         temp=temp/b;

 ^
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
         length++;    

 ^
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: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: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
     

 ^
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
     for(i=0;i<length;i++){

 ^
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
         //catul impartirilor la puterile bazei 

 ^
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
         //pornind de la cel mai mare exponent 

 ^
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:21:1: error: stray '\302' in program
         //se adauga la numar in formatul bazei

 ^
bits.cpp:21:1: error: stray '\240' in program
bits.cpp:21:1: error: stray '\302' in program
bits.cpp:21:1: error: stray '\240' in program
bits.cpp:21:1: error: stray '\302' in program
bits.cpp:21:1: error: stray '\240' in program
bits.cpp:21:1: error: stray '\302' in program
bits.cpp:21:1: error: stray '\240' in program
bits.cpp:21:1: error: stray '\302' in program
bits.cpp:21:1: error: stray '\240' in program
bits.cpp:21:1: error: stray '\302' in program
bits.cpp:21:1: error: stray '\240' in program
bits.cpp:22:1: error: stray '\302' in program
         res=res*10+(n/pow(b,length-1-i));

 ^
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
         n=n%int(pow(b,length-1-i));

 ^
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: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:25:1: error: stray '\302' in program
         

 ^
bits.cpp:25:1: error: stray '\240' in program
bits.cpp:25:1: error: stray '\302' in program
bits.cpp:25:1: error: stray '\240' in program
bits.cpp:25:1: error: stray '\302' in program
bits.cpp:25:1: error: stray '\240' in program
bits.cpp:25:1: error: stray '\302' in program
bits.cpp:25:1: error: stray '\240' in program
bits.cpp:25:1: error: stray '\302' in program
bits.cpp:25:1: error: stray '\240' in program
bits.cpp:25:1: error: stray '\302' in program
bits.cpp:25:1: error: stray '\240' in program
bits.cpp:26:1: error: stray '\302' in program
     }

 ^
bits.cpp:26:1: error: stray '\240' in program
bits.cpp:26:1: error: stray '\302' in program
bits.cpp:26:1: error: stray '\240' in program
bits.cpp:26:1: error: stray '\302' in program
bits.cpp:26:1: error: stray '\240' in program
bits.cpp:27:1: error: stray '\302' in program
     cout<<res;

 ^
bits.cpp:27:1: error: stray '\240' in program
bits.cpp:27:1: error: stray '\302' in program
bits.cpp:27:1: error: stray '\240' in program
bits.cpp:27:1: error: stray '\302' in program
bits.cpp:27: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;

                   ^
bits.cpp:27:17: error: expected '}' at end of input
     cout<<res;

                 ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema bits face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.