#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 | #31776138 | Utilizator | |
Fișier | getbit.c | Dimensiune | 618 B |
Data încărcării | 23 Octombrie 2021, 11:02 | Scor / rezultat | Eroare de compilare |
getbit.c: In function 'main': getbit.c:8:5: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'long long int *' [-Wformat=] scanf("%d", &T); ^ getbit.c:9:5: error: 'for' loop initial declarations are only allowed in C99 mode for (long long int i=1; i<=T; ++i) ^ getbit.c:9:5: note: use option -std=c99 or -std=gnu99 to compile your code getbit.c:12:9: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'long long int *' [-Wformat=] scanf("%d %d", &n, &b); ^ getbit.c:12:9: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'long long int *' [-Wformat=] getbit.c:28:24: error: redefinition of 'i' for (long long int i=1; i<=T; ++i) ^ getbit.c:9:24: note: previous definition of 'i' was here for (long long int i=1; i<=T; ++i) ^ getbit.c:28:5: error: 'for' loop initial declarations are only allowed in C99 mode for (long long int i=1; i<=T; ++i) ^ getbit.c:29:9: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=] printf("%d", vb[i]); ^ getbit.c:8:10: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &T); ^ getbit.c:12:14: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &n, &b); ^
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ă.