Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <unistd.h>
- #include <stdio.h>
- int main() {
- unsigned short n; // 2 байта
- char buffer; // 1 байт
- while (scanf("%hu", &n) != 0) {
- unsigned short buf1 = n >> size_t(buffer);
- unsigned short buf2 = n;
- int deskriptor = open("myfile", O_RDWR, 0600);
- write (deskriptor, &buf1, sizeof(buffer));
- write (deskriptor, &buf2, sizeof(buffer));
- close (deskriptor);
- }
- printf("%d\n", 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement