結果
| 問題 |
No.8010 Print inside /bin
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2016-12-27 16:56:24 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 533 bytes |
| コンパイル時間 | 253 ms |
| コンパイル使用メモリ | 22,144 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-15 03:35:37 |
| 合計ジャッジ時間 | 1,145 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 1 |
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
int comp(const void *a, const void *b) {
return strcmp((char *)a, (char *)b);
}
int main(void) {
DIR *dir;
struct dirent *dp;
dir = opendir("/bin");
char list[256][64];
int cnt = 0;
for (dp = readdir(dir); dp != NULL; dp = readdir(dir)) {
char *t = dp -> d_name;
if (t[0] != '.') strcpy(list[cnt++], t);
}
closedir(dir);
qsort(list, cnt, sizeof(char) * 64, comp);
int i;
for (i = 0; i < cnt; i++) printf("%s\n", list[i]);
return 0;
}
くれちー