C
- voluntas
- @ignis_fatuus
- ブン
- @Linda_pp
- 清楚なC++メイドBOT
- @tzik_tack
- 長谷川一輝
- wraith13
- @jj1bdx
- @cpp_akira
- 安藤敏彦
- @srz_zumix
- Siv3D
- takezoh
- まろ
- @okdshin
- @hnokx
- @ishidakei
- @take_cheeze
- TAKEI Yuya
- @mumumu
- I (@wx257osn2)
- Tommy6
- @tyottyoworks
- ___shanon
- わたやん
- @KorekaraSEDB
- @kariya_mitsuru
- @ciniml
- @beam2d
- @grafi_tt
- @nekketsuuu
- LouiS0616
- @volanja
- 大鎌広
- むてら
- ガチKGB
- 三重野賢人
x
26
1
2
3
int main(void) {
4
char s[64];
5
int size = sizeof(s);
6
int i;
7
/* initialize array */
8
for (i = 0; i < size; i++) s[i] = (char)0xff;
9
10
/* call fgets() */
11
fgets(s, 32, stdin);
12
13
/* print contents of the array */
14
for (i = 0; i < size; i++) {
15
printf("%02X ", (unsigned char)s[i]);
16
if ((i + 1) % 16 == 0) {
17
int j, offset = (i / 16) * 16;
18
for (j = 0; j < 16; j++) {
19
putchar(0x20 <= s[offset + j] && s[offset + j] < 0x7f ? s[offset + j] : '.');
20
}
21
putchar('\n');
22
}
23
}
24
return 0;
25
}
26
$ gcc prog.c -Wall -Wextra -std=gnu11
Stdin
Earth is the third planet from the Sun
The only astronomical object known to harbor life
About 29% of Earth's surface is land consisting of continents and islands
Start
45 61 72 74 68 20 69 73 20 74 68 65 20 74 68 69 Earth is the thi 72 64 20 70 6C 61 6E 65 74 20 66 72 6F 6D 20 00 rd planet from . FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................ FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
0
Finish