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 | |
# 步驟一:匯入 tkinter 模組。 | |
from tkinter import Tk, Label, Entry, Radiobutton, IntVar | |
# 步驟二:建立主視窗。 | |
mainWin = Tk() | |
var = IntVar() | |
operation = [ '+', '-', '*', '/'] |
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 <SoftwareSerial.h> | |
#include <Wire.h> | |
SoftwareSerial CAR_BT(11,12); //定義 PIN11 及 PIN12 分別為 RX 及 TX 腳位 | |
/* Input for leftMotor: | |
IN1 IN2 Action | |
LOW LOW Stop | |
HIGH LOW Forward | |
LOW HIGH Backward |
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
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
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
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
const short SIZE = 9; | |
void prtMsg(bool b) | |
{ | |
cout << (b?"yes":"no") << 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
class Solution { | |
public: | |
vector<int> twoSum(vector<int>& nums, int target) { | |
multimap<int, int> nTable; | |
multimap<int, int>::iterator it, cur; | |
vector<int> result; | |
for(int i = 0; i < nums.size(); i++) | |
nTable.insert(make_pair(nums[i], 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
#include <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int main() { | |
int n; | |
while( scanf("%d", &n) != EOF ) { | |
int *number = new int[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
#include <cstdio> | |
using namespace std; | |
int main() { | |
int n; | |
while( scanf("%d", &n) != EOF ) { | |
if( n == 0 ) | |
break; |
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 <cstdio> | |
#include <iostream> | |
using namespace std; | |
int main() { | |
int CNT = 4; | |
int answer[CNT]; | |
int guess[CNT]; | |
int idx = 0; |
NewerOlder