https://www.coolutils.com/online/XML-to-PNG

 

Convert XML to PNG Online for Free | CoolUtils

DescriptionXML is a versatile kind of language, which resembles HTML. Although they seem to have pretty much in common, as both are based on tags and define documentsí content and structure, they cannot replace each other. First, HTML demonstrates data, w

www.coolutils.com

무료/  회원가입 불필요

XML-> PNG 를 드래그 앤 드롭 또는 파일 업로드로 간편하게 할 수 있다.

변환할 XML 파일을 저기 회색 박스 영역에 드래그하고 다운로드 버튼누르면 된다.

 

여러개의 파일을 한번에 변환은 회원 전용 기능이지만

하나씩해도 금방되서 이거만해도 충분할것같다

 

그밖에 이미지 파일 변환 기능 등 여러 기능이 있는데 나머지는 유료기능이라 안써봤다

'기타' 카테고리의 다른 글

SQLD 59회 합격후기  (0) 2026.01.27

설명

서버에 ping을 전송하여 현재 정상적으로 통신이 되는지 확인하는 코드이다.

하단 코드에 대상서버는 필요에 따라 변경하면 된다.

응답처리부분을 추가 하면은 에러 코드를 확인하여 어떤 네트워크 문제가 있었는지도 확인 가능하다.

(ex: 권한 없음, 호스트 오류, 서버 오류)

 

전체 코드

#include <iostream>
#include <vector>
#include <string>
#include <afxstr.h>
#include <cstring>
#include <winsock2.h>
#include <mstcpip.h>
#include <iphlpapi.h>
#include <icmpapi.h>
#include <Windows.h>
#include <WinUser.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sstream>
#include <exception>
#include <ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "iphlpapi.lib")

using namespace std;
// 특정 서버 ping 전송 테스트
bool PingtoHost()
{
	try
	{
		// 타겟 주소
		std::string target = "www.naver.com";
		DWORD pingTimeout = 1000;
		char sendData[] = "Ping Test";

		HANDLE hIcmpFile = IcmpCreateFile();
		if (hIcmpFile == INVALID_HANDLE_VALUE)
		{
			return false;
		}

		BYTE replyBuffer[1024];
		DWORD replySize = sizeof(replyBuffer);

		PICMP_ECHO_REPLY pEchoReply = (PICMP_ECHO_REPLY)replyBuffer;

		// 도메인 이름을 IP 주소로 변환
		sockaddr_in destAddr;
		ZeroMemory(&destAddr, sizeof(destAddr));
		destAddr.sin_family = AF_INET;

		struct addrinfo* result = nullptr;
		struct addrinfo hints;
		ZeroMemory(&hints, sizeof(hints));
		hints.ai_family = AF_INET; 

		int iResult = getaddrinfo(target.c_str(), NULL, &hints, &result);
		if (iResult != 0)
		{
			IcmpCloseHandle(hIcmpFile);
			WSACleanup();
			return false;
		}

		destAddr.sin_addr = ((struct sockaddr_in*)result->ai_addr)->sin_addr;


		// ping 전송
		DWORD dwResult = IcmpSendEcho(
			hIcmpFile,
			destAddr.sin_addr.s_addr, // 변환 IP 주소
			sendData,
			sizeof(sendData),
			NULL,
			replyBuffer,
			replySize,
			pingTimeout
		);

		if (result == 0)
		{
			DWORD error = GetLastError();
			CString errorMessage;
			return false;
		}
		else
		{
			return true;
		}

		IcmpCloseHandle(hIcmpFile);
	}
	catch (std::exception ex)
	{
	}
}

 

GitHub

https://github.com/Chaeyunbyun/Network_Utils/blob/main/Http_Utils.cpp

 

Network_Utils/Http_Utils.cpp at main · Chaeyunbyun/Network_Utils

Http/ Https 통신 및 소켓 통신 관련 함수. Contribute to Chaeyunbyun/Network_Utils development by creating an account on GitHub.

github.com

 

'C++, MFC' 카테고리의 다른 글

C++ 클래스 정리  (2) 2025.08.14

헤더

#include <bitset>

선언

 // 사이즈 5인 이진 배열
 bitset<5> bit;

10진수 -> 2진수

int n = 10;
bitset<6> b(n);

2진수-> 10진수

bitset<6> bit("1010");
int n = bit.to_ulong();

비트 검사

// 모든 비트가 1이면 true
bit.all()
// 하나 이상의 비트가 1이면 true
bit.any()
// 모든 비트가 0이면 true
bit.none

bitset는 여러 비트연산을 할 수 있도록 지원한다.

비트마스크 연산 또는 이진수 변환시 유용하게 사용가능하다.

 

비트마스크 연산

and, or, not , xor, 시프트 연산 등이 있다.

'C++, MFC > STL 정리' 카테고리의 다른 글

[c++ STL정리] - vector  (0) 2025.02.04

https://www.acmicpc.net/problem/15688

문제 분석

입력된 숫자들을 비내림차순으로 정렬하여 출력하는 문제입니다.

비내림차순하고 오름차순이랑 뭐가다른진 모르겠네요. 

vector로 받은 다음에 sort 로 정렬해서 오름차순으로 출력해서 풀었습니다.

 

소스 코드

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
using std::cin;
using std::cout;

int main()
{ 
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n;
	cin >> n;
	vector<int> v(n);
	for (int i = 0; i < n; i++)
	{
		int k;
		cin >> k;
		v[i] = k;
	}
	sort(v.begin(), v.end());
	for (auto a : v)
	{
		cout << a << "\n";
	}
}

 

'백준 > 실버' 카테고리의 다른 글

[백준 1622]- 공통 순열(c++)  (0) 2026.04.03
[백준 15729]- 방탈출(c++)  (0) 2026.03.25
[백준 3060]- 욕심쟁이 돼지(c++)  (0) 2026.03.23
[백준 14916] - 거스름돈(c++)  (0) 2026.03.16
[백준 1340] - 연도 진행바  (0) 2026.03.05

https://www.acmicpc.net/problem/1622

문제 분석

순열이라 되어있지만 실제론 문자열 a, b 에서 일치하는 문자들을 붙이면된다.

사전순으로 출력 하라고되어 있으므로 정렬 후에 출력 하면 된다.

string 문자열도 sort() 를 사용해서 바로 정렬 할 수 있으니 사용해 주었다.

for (int i = 0; i < a.size(); i++)
	{
		for (int j = 0; j < b.size(); j++)
		{
			if (a[i] == b[j])
			{
				tmp += a[i];
				a[i] = ' ';
				b[j] = ' ';
				break;
			}
		}
	}

같은 문자가 여러 번 나오는 경우 중복으로 카운트 하는것을 방지하기 위해

해당위치의 문자를 공백으로 바꾸고,

break 를 빠져나온다.

소스코드

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
using std::cin;
using std::cout;

int main()
{ 
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	string a, b;
	while (getline(cin, a) && getline(cin, b))
	{
		string tmp = "";
		for (int i = 0; i < a.size(); i++)
		{
			for (int j = 0; j < b.size(); j++)
			{
				if (a[i] == b[j])
				{
					tmp += a[i];
					a[i] = ' ';
					b[j] = ' ';
					break;
				}
			}
		}
		sort(tmp.begin(), tmp.end());
		cout << tmp <<"\n";
	}
	return 0;
}

 

'백준 > 실버' 카테고리의 다른 글

[백준 15688]- 수 정렬하기(c++)  (0) 2026.04.03
[백준 15729]- 방탈출(c++)  (0) 2026.03.25
[백준 3060]- 욕심쟁이 돼지(c++)  (0) 2026.03.23
[백준 14916] - 거스름돈(c++)  (0) 2026.03.16
[백준 1340] - 연도 진행바  (0) 2026.03.05

https://www.acmicpc.net/problem/18129

문제 분석

먼저 입력받은 문자열을 대소문자 상관없이 구간으로 처리한다. 따라서 먼저 문자열 전체를 소문자(혹은 대문자) 로 치환한다.

그리고 0 또는 1로 치환하고 이전에 치환된 적 있는 알파벳이라면 해당 부분은 삭제한다.

그리고 이전에 나왔는지 체크해 주기 위해서 map구조체를 선언 하고 <알파벳, 등장 횟수> 로 저장해 주었다.

등장한 적 있는 알파벳 삭제할 때는 공백으로 치환한 뒤 마지막에 제거해주었다.

 

소스 코드

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <climits>
#include <algorithm>
#include <map>
using namespace std;
using std::cin;
using std::cout;

int main()
{ 
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	// 대 소문자 구분 x
	map<char, int> ch;
	string str;
	cin >> str;
	int k;
	cin >> k;

	string ans = "";

	bool fl = false;
	// 대 소문자 구분 x
	for (int i = 0; i < str.size(); i++)
	{
		str[i] = tolower(str[i]);
	}
	str += ',';
	// 반복 횟수
	int cnt = 0;
	for (int i = 0; i < str.size(); i++)
	{
		// 이전과 다른 문자가 나온 경우 또는 마지막
		if ((i > 0 && str[i-1] != str[i]))
		{
			if (cnt >= k)
			{
				ans += '1';
			}
			else
			{
				ans += '0';
			}
			// map 에 추가
			ch[str[i-1]]++;

			// 동일 문자가 있는 경우 뒤 제거
			if (ch[str[i-1]] > 1)
			{
				ans[ans.size() - 1] = ' ';
			}
			cnt = 1;
		}
		// 문자 반복 중
		else
		{
			cnt++;
		}
	}
	string answer;
	for (int i = 0; i < ans.size(); i++)
	{
		if (ans[i]!= ' ')
		{
			answer += ans[i];
		}
	}
	cout << answer;
}

 

'백준 > 브론즈' 카테고리의 다른 글

[백준 17487]- 타자 연습(c++)  (0) 2026.03.27
[백준 22986]- Flat Earth(c++)  (0) 2026.03.23
[백준 27160] - 할리갈리(C++)  (0) 2025.12.18

 

https://school.programmers.co.kr/learn/courses/30/lessons/17682

 

프로그래머스

SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr

 

문제 분석

문제의 조건에 따라 점수 계산을 구현 하면 된다.

먼저 string 값으로 들어온 입력에서

각 인덱스별 char 값이 점수, 옵션(스타상, 아차상), SDT 영역이 들어올 수 있다.

먼저 char 값이 어떤 영역에 해당하는지 체크한다.

0~9 이면 점수,

S, D, T 이면 SDT,

*. # 이면 옵션 영역이다.

 

옵션중에서 스타상의 경우 점수 계산시 이전 점수와 현재 점수에 *2를 해야 하므로,

각 라운드별 점수를 벡터에 저장해 두었다 나중에 합산하는 식으로 풀었다.

 

그리고 점수는 0~ 10 까지 입력 될 수 있는데, 10은 두 자리에 걸쳐서 들어오니

따로 처리해 주어야 한다.

저는 이전 인덱스와 현재 인덱스를 함께 확인하여 처리했습니다. 

            // 점수 - 10
            if (i > 0 && dartResult[i - 1] == '1' && dartResult[i] == '0')
            {
                curr = 10;
            }

 

소스 코드

#include <string>
#include <vector>
#include <algorithm>

using namespace std;
int power(int base, int n)
{
    int ret = 1;
    for(int i = 0; i < n; i++)
    {
        ret*= base;
    }
    return ret;
}

int solution(string dartResult) {
    int answer = 0;
    int curr = 0;
    vector<int> vec;
    for(int i =0; i < dartResult.size(); i++)
    {
        if(dartResult[i] >= '0' && dartResult[i] <= '9')
        {
            // 점수 - 10
            if(i> 0 && dartResult[i -1] == '1' && dartResult[i] == '0')
            {
                curr = 10;
            }
            else
            {
                curr = dartResult[i] - '0';
            }
        }
        // 보너스
        if(dartResult[i] == 'S' || dartResult[i] == 'D'|| dartResult[i] == 'T')
        {
            if(dartResult[i] == 'D')
            {
                curr = power(curr, 2);
            }
            if(dartResult[i] == 'T')
            {
                curr = power(curr, 3);
            }
            vec.push_back(curr);
        }
        // 옵션
        if(dartResult[i] == '*' || dartResult[i] == '#')
        {
            if(dartResult[i] == '*')
            {
                if(vec.size()== 1)
                {
                    vec[vec.size()-1] = vec[vec.size()-1] * 2;
                }
                else
                {
                    vec[vec.size()-1] = vec[vec.size()-1] * 2;
                    vec[vec.size()-2] = vec[vec.size()-2] * 2;
                }
            }
            else
            {
                vec[vec.size()-1] = vec[vec.size()-1] * -1;
            }
        }
    }
    for(int i= 0; i< vec.size(); i++)
    {
        answer+= vec[i];
    }
    return answer;
}

'프로그래머스' 카테고리의 다른 글

[Lv.1] [1차] 비밀지도 (c++)  (0) 2026.03.27
[Lv.1] 소수 만들기  (0) 2026.03.26

https://school.programmers.co.kr/learn/courses/30/lessons/17681

 

프로그래머스

SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr

문제 분석

입력된 배열 arr1,arr2 의 요소들을 이진법으로 변환해서,

or 조건으로 비교 한 후 하나라도 1 이면 #(울타리), 아니면 ' '(공백)인 문자열로 만든후

vector 배열에 담아서 리턴하면 된다.

이진법으로 변환하는 부분 구현은 저는 2로 반복해서 나누어 string 에 담은 후  for 문을 사용해 뒤집어서 얻었습니다.

vector<int> 배열에 담았다면 reverse() 써서 더 간단하게 해도 될 것 같습니다.

처음에 입력받은 n(한 변의 길이) 에 맞추어 주어야 하기 때문에 0을 추가해서 자릿수를 맞추어 줍니다.

string tobinary(int n, int len)
{
    string str = "";
    string tmp = "";
    int x = n;
    while(x!= 0)
    {
        if(x%2 ==0)
        {
            tmp+='0';
        }
        else
        {
            tmp+='1';
        }
        x= x/2;
    }
    for(int i= tmp.size()-1; i>= 0; i--)
    {
        str+= tmp[i];
    }
    while(str.length() < len)
    {
        str = '0' + str;
    }
    return str;
}

 

소스 코드

#include <string>
#include <vector>

using namespace std;
string tobinary(int n, int len)
{
    string str = "";
    string tmp = "";
    int x = n;
    while(x!= 0)
    {
        if(x%2 ==0)
        {
            tmp+='0';
        }
        else
        {
            tmp+='1';
        }
        x= x/2;
    }
    for(int i= tmp.size()-1; i>= 0; i--)
    {
        str+= tmp[i];
    }
    while(str.length() < len)
    {
        str = '0' + str;
    }
    return str;
}

vector<string> solution(int n, vector<int> arr1, vector<int> arr2) {
    vector<string> answer;
    for(int i=0; i< arr1.size(); i++)
    {
        string str1 = tobinary(arr1[i], n);
        string str2 = tobinary(arr2[i], n);
        string astr = "";
        for(int j=0; j< str1.size(); j++)
        {
            if(str1[j]== '1' || str2[j] == '1')
            {
                astr+='#';
            }
            else
            {
                astr += ' ';
            }
        }
        answer.push_back(astr);
    }
    return answer;
}

 

'프로그래머스' 카테고리의 다른 글

[Lv.1] [1차] 다트게임 (c++)  (0) 2026.03.27
[Lv.1] 소수 만들기  (0) 2026.03.26

+ Recent posts