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 <cstring> | |
using namespace std; | |
int main() | |
{ | |
int n, m; | |
cin >> n >> m; | |
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() | |
{ | |
int board[100][100] = {0}; | |
int h, w; | |
cin >> h >> w; |
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() | |
{ | |
int n; | |
cin >> n; | |
int seq[n]; |
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 sys | |
msg = {0:"PERFECT", 1:"ABUNDANT", -1:"DEFICIENT"} | |
def checkPerfection(n): | |
sum = 0 | |
for i in range(1, (n // 2) + 1, 1): | |
if( n % i == 0 ): | |
sum += 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
task main() | |
{ | |
// Moving Forward | |
motor[motorC] = 100; | |
motor[motorB] = 100; | |
wait1Msec(1000); | |
// Moving Backword | |
motor[motorC] = -100; |
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
#!/bin/bash | |
for i in {1..5} | |
do | |
python TCP_Client.py | |
done |
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
#!/usr/bin/python | |
import socket | |
s = socket.socket() | |
host = socket.gethostname() # 取得目前機器名稱 | |
print(host) | |
port = 12345 # 程式的 port number | |
s.connect((host, port)) # 連線到 server | |
recvMsg = s.recv(1024) # 接收 server 傳來的訊息 |
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
#!/usr/bin/python | |
import socket | |
s = socket.socket() | |
host = socket.gethostname() # 取得目前機器名稱 | |
print(host) | |
port = 12345 # 程式的 port number | |
s.bind((host, port)) | |
s.listen(5) # 等待 client 連線 |
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
# -*- coding: utf-8 -*- | |
import pygame | |
pygame.init() | |
# | |
# Step 1: Create the screen window | |
# | |
# Screen width, height | |
S_W = 500 |
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
class Solution { | |
public: | |
vector<int> twoSum(vector<int>& nums, int target) { | |
multimap<int, int> nTable; | |
multimap<int, int>::iterator it; | |
vector<int> result; | |
for(int i = 0; i < nums.size(); i++) { | |
int c = target - nums[i]; | |
nTable.insert(make_pair(nums[i], i)); |
NewerOlder