Skip to content

Instantly share code, notes, and snippets.

View pinglunliao's full-sized avatar

pinglunliao pinglunliao

View GitHub Profile
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
#include <iostream>
using namespace std;
int main()
{
int board[100][100] = {0};
int h, w;
cin >> h >> w;
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int seq[n];
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
task main()
{
// Moving Forward
motor[motorC] = 100;
motor[motorB] = 100;
wait1Msec(1000);
// Moving Backword
motor[motorC] = -100;
#!/bin/bash
for i in {1..5}
do
python TCP_Client.py
done
#!/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 傳來的訊息
#!/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 連線
@pinglunliao
pinglunliao / PygameKeyboard.py
Created June 3, 2019 03:21
Moving a sprite with keyboard
# -*- coding: utf-8 -*-
import pygame
pygame.init()
#
# Step 1: Create the screen window
#
# Screen width, height
S_W = 500
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));