This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
const int strsize = 20; | |
const int SIZE = 5; | |
struct bop | |
{ | |
char fullname[strsize]; // real name | |
char title[strsize]; //job title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<string> | |
#include<cctype> | |
using namespace std; | |
int main() | |
{ | |
string a; | |
cout << "Enter words (q to quit): " << endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<fstream> | |
using namespace std; | |
const int SIZE = 100; | |
int main() | |
{ | |
char filename[SIZE]; | |
ifstream inFile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<limits.h> | |
int main(int argc, char const *argv[]) | |
{ | |
int x = -123; | |
int ans = 0; | |
while(x != 0) | |
{ | |
int pop = x % 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include <string.h> | |
using namespace std; | |
string defangIPaddr(string address) | |
{ | |
for (int i = 0; i < address.length(); ++i) | |
{ | |
if (address[i] == '.') | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/solution/ | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
class Solution | |
{ | |
public: | |
int removeDuplicates(vector<int>& nums) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 <iostream> | |
#include <vector> | |
#include <math.h> | |
using namespace std; | |
class Solution | |
{ | |
public: |
OlderNewer