Skip to content

Instantly share code, notes, and snippets.

View kenornotes's full-sized avatar
🏠
Working from home

Sky N̂g kenornotes

🏠
Working from home
  • Imonology Inc.
  • Melbourne, Victoria, Australia
View GitHub Profile

logdown

記錄設備操作及狀態

save(description ,status, other)

記錄寫入包含敘述、時間、狀態 其他如設備的操作記錄 包含設備id, 操作名稱

參數:

```
Hydra
`-lib
`-lobby
`-wrapper
`-connector
`-web
`-doc
```

側欄

folder:

    "bold_folder_labels": true,

編輯區

@kenornotes
kenornotes / judge1-2.c
Last active August 29, 2015 14:11
judge1-2
#include <stdio.h>
int main() {
//size for input
//i, j fot loop
int size, i, j, tmp;
scanf("%d", &size);
for (i = 1; i <= size; i++) {
for (j = 1; j <= size; j++) {
//print the greater one of i and j;
tmp = i;
@kenornotes
kenornotes / judge1-1.c
Created December 10, 2014 17:28
judge1-1
/*
* 方塊酥堆成同樣高度時,其高為方塊酥總數的算術平均數(總數/堆數)
* 所以只要取得均高,再把超過均高的一一拿下來補滿不足均高的,就會是移動次數最少的方式
*/
#include <stdio.h>
// 計算最少移動次數
int moveTimes(int h[], int n) {
// 計算總共有幾個方塊酥
int i, sum = 0;
for(i = 0; i < n; i++)
#include <stdio.h>
//判斷 x 是否為質數
int isPrime(int x) {
int i;
for (i = 2; i < x; i++) {
//出現 1 及 x 本身以外的因數,所以不是質數
if ( x % i == 0 )
return 0;
}
//全部檢查完沒有 1 及 x 本身以外的因數,是質數
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//判斷 x 是否為質數
int isPrime(int x) {
int i;
for (i = 2; i < x; i++) {
//出現 1 及 x 本身以外的因數,所以不是質數
if ( x % i == 0 )
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void sort(int x[], int n) {
/* 略 */
}
// 亂數取得號碼,放至 drwaNum[] 中
void getDrawNum(int drawNum[]) {
#include <stdio.h>
//判定是不是一串1
int isOnes(int n) {
while(n > 0) {
if(n % 10 != 1)
return 0;
n /= 10;
}
return 1;
}
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void sort(int x[], int n) {
/* 上課教過 */
}
// 亂數取得號碼,放至 drawNum[] 中
void getDrawNum(int drawNum[]) {
/* 見 Judge 2-1 */