Skip to content

Instantly share code, notes, and snippets.

View penut85420's full-sized avatar
😎
I Love Oppai!

PenutChen penut85420

😎
I Love Oppai!
  • Graduate Student of National Taiwan Ocean University
  • New Taipei, Taiwan
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@penut85420
penut85420 / int_array_eof.cpp
Last active October 22, 2017 12:16
int array with eof
#include <stdio.h>
#include <stdlib.h>
int main() {
int i = 0, n[100];
while (scanf("%d", &n[i++]) != EOF) ; i--;
for (int j = 0; j < i; j++)
printf("%d ", n[j]);
@penut85420
penut85420 / Num123.java
Last active November 20, 2017 08:53
Splite num sequence
package com.Test;
public class Num123 {
public static void main(String[] args) {
int n = 5;
foo(2, n, "1");
}
public static void foo(Integer i, Integer n, String s) {
@penut85420
penut85420 / Polymorphism.java
Created December 13, 2017 19:15
A note of Polymorphism.
abstract class Animal {
abstract String talk();
}
class Cat extends Animal {
String talk() {
return "Meow!";
}
}
@penut85420
penut85420 / Overloading.java
Created December 13, 2017 19:24
A note of Overloading.
public class Overloading {
public static String foo(int n) {
return "This is int " + n;
}
public static String foo(String s) {
return "This is String " + s;
}
public static void main(String[] args) {
@penut85420
penut85420 / Overriding.java
Created December 13, 2017 19:30
A note of Overriding.
class Animal {
public String talk() {
return "Hi";
}
}
class Dog extends Animal {
public String talk() {
return "Woof!";
}

Coding 大神

  1. 前天說要學C,今天就DEMO河內塔給你看
  2. 前天說要學C++,今天就DEMO俄羅斯方塊給你看
  3. 前天說要學Web,今天就DEMO一個Judge系統給你看
  4. 前天說要學Java,今天就DEMO一個MP3管理系統給你看
  5. 前天說要學Python,今天就DEMO一個圖像辨識系統給你看
  6. 半年限的Project他花一個月就搞定
  7. 這一個月的前三個禮拜你還看他在打Online Game
  8. 他的世界裡只有10種人
#include <iostream>
#include <vector>
using namespace std;
void print_vector(vector<int>& v) {
for(int i = 0; i < v.size(); i++) {
cout << v[i] << " ";
}
}
isPrime = False
while isPrime == False:
number1 = eval(input("請輸入一個數值: "))
isPrime = True
k = 2
while k < number1 and isPrime:
if number1 % k == 0:
isPrime = False
public static String file_read(String file) {
String sFile = null;
try {
FileInputStream fin = new FileInputStream(file);
byte ba[] = new byte[fin.available()];
fin.read(ba);
// 將文字用UTF-8解碼
sFile = new String(ba, "UTF-8");
// 將BOM檔頭去掉
sFile = sFile.replace("\uFEFF", "");