Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- 2 │ #include <sys/stat.h>
- 3 │ #include <stdint.h>
- 4 │
- 5 │
- 6 │ int main(int argc, char** argv) {
- 7 │ struct stat info;
- 8 │ int64_t ans = 0;
- 9 │ for (int i = 1; i < argc; ++i) {
- 10 │ if (lstat(argv[i], &info) == -1) {
- 11 │ continue;
- 12 │ }
- 13 │ if (S_ISLNK(info.st_mode) == 0 && info.st_nlink == 1) {
- 14 │ ans += info.st_size;
- 15 │ }
- 16 │ }
- 17 │ printf("%lld\n", ans);
- 18 │ }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement