Skip to content

Instantly share code, notes, and snippets.


amankharwal/defang.cpp Secret

Created Feb 22, 2021
What would you like to do?
#include <bits/stdc++.h>
using namespace std;
string DefangIP(string str)
string defangIP = "";
for (char c : str)
(c == '.') ? defangIP += "[.]" :
defangIP += c;
return defangIP;
int main()
string str;
cout <<DefangIP(str);
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment