#2577
getbit
Se dau mai multe perechi de forma număr, bit. Afișați pentru fiecare pereche valoarea bitului corespunzător din reprezentarea internă pe 64 de biți a numărului dat.
Problema | getbit | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #29424303 | Utilizator | |
Fișier | getbit.c | Dimensiune | 261 B |
Data încărcării | 27 Aprilie 2021, 11:34 | Scor / rezultat | Eroare de compilare |
getbit.c: In function 'main': getbit.c:9:5: error: 'for' loop initial declarations are only allowed in C99 mode for(int i = 1; i<= n;i++) { ^ getbit.c:9:5: note: use option -std=c99 or -std=gnu99 to compile your code getbit.c:10:9: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'long long int *' [-Wformat=] scanf("%d %d",&number, &k); ^ getbit.c:11:9: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=] printf("%d",((number >> k) & 1LL)); ^ getbit.c:8:10: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ getbit.c:10:14: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d",&number, &k); ^ getbit.c:14:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema getbit 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ă.