{{ message }}

Instantly share code, notes, and snippets.

# 2hanX 2hanX

Created Nov 22, 2020
 // https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/solution/mai-mai-gu-piao-de-zui-jia-shi-ji-ii-by-leetcode-s/ #include #include #include using namespace std; class Solution { public:
Created Nov 22, 2020
View remove-duplicates-from-sorted-array.cpp
 // https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/solution/ #include #include using namespace std; class Solution { public: int removeDuplicates(vector& nums)
Last active Nov 21, 2020
View change_mac_4_linux.py
 import re import subprocess from random import choice, randint interface = input("Enter your network interface: ").strip() choice_num = input("Enter your new mac address[0]/random mac[1]: ").strip() if choice_num == 0: new_mac = input("new mac: ").strip() else choice_num == 1: new_mac = mac_random()
Created Sep 27, 2020

 #include #include using namespace std; string defangIPaddr(string address) { for (int i = 0; i < address.length(); ++i) { if (address[i] == '.') {
Created Sep 11, 2020

View reverse_int.cpp
 #include #include int main(int argc, char const *argv[]) { int x = -123; int ans = 0; while(x != 0) { int pop = x % 10;
Created Jun 20, 2020
View 6.11.8.cpp
 #include #include using namespace std; const int SIZE = 100; int main() { char filename[SIZE]; ifstream inFile;
Created Jun 20, 2020
View 6.11.7.cpp
 #include #include #include using namespace std; int main() { string a; cout << "Enter words (q to quit): " << endl;
Created Jun 20, 2020
View 6.11.4.cpp
 #include using namespace std; const int strsize = 20; const int SIZE = 5; struct bop { char fullname[strsize]; // real name char title[strsize]; //job title
Created Jun 20, 2020
View 6.11.3.cpp
 #include using namespace std; int main() { cout << "Please enter one of the following choices: " << endl; cout << " c) carnivore \t\t\t p) pianist" << endl; cout << " t) tree \t\t\t g) game" << endl; char choice;
Last active Jun 20, 2020
View 6.11.2.cpp
 #include #include using namespace std; const int SIZE = 10; int main() { array donation; double sum = 0.0;