자료실 > 유머게시판
쪽지 | 작성글보기 | 신고
https://www.bobaedream.co.kr/view?code=strange&No=6207754
아, 몰랑, 아무 코드나 아무렇게나 찍을거야, 하면서 괴상한 코드 출력함 ㅋㅋㅋ아, 몰랑, 아무 코드나 아무렇게나 찍을거야, 하면서 괴상한 코드 출력함 ㅋㅋㅋ
댓글 작성을 위해 로그인 해주세요.
0/2000자
목록 이전페이지 맨위로
#include <iostream>
#include <filesystem>
#include <string>
int main() {
std::filesystem::path filePath = "mybeep.exe";
if (std::filesystem::exists(filePath)) {
std::string diskType;
std::filesystem::file_status status = std::filesystem::status(filePath);
switch (status.type()) {
case std::filesystem::file_type::directory:
diskType = "Directory";
break;
case std::filesystem::file_type::regular:
// Check disk type based on the file path
if (filePath.string().find("C:") == 0) {
diskType = "SATA";
} else if (filePath.string().find("D:") == 0) {
diskType = "SATA";
} else if (filePath.string().find("E:") == 0) {
diskType = "USB 2.0";
} else if (filePath.string().find("F:") == 0) {
diskType = "USB 3.0";
} else if (filePath.string().find("G:") == 0) {
diskType = "SD Card";
} else {
diskType = "Unknown";
}
break;
default:
diskType = "Unknown";
break;
}
std::cout << "File exists on a " << diskType << " device." << std::endl;
} else {
std::cout << "File does not exist." << std::endl;
}
return 0;
}
0/2000자