Skip to content

Instantly share code, notes, and snippets.

public class StepCount {
// 全ライン数
private static int AllStep;
// 実コードライン数
private static int CodeStep;
// コメントライン数
private static int CommentStep;
// 空白ライン数
private static int EmptyStep;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class FileAnalyze {
private File javaFile;
enum LineStatus {
CODE(0), COMMENT(1), EMPTY(2), BLOCKCOMMENT(3);
import java.io.File;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//解析対象ファイル
@skRyo
skRyo / View.java
Created August 7, 2012 12:16
教えてエライ人3
package com.example;
class Control {
//四角形の面積計算
static int calcRectangle(Model m){
return m.getWidth() * m.getHeight();
}
//重なった四角形の頂点x計算
@skRyo
skRyo / gist:3217011
Created July 31, 2012 13:22 — forked from giuniu/gist:3208264
教えてエライ人2
interface Debugprintable {
enum ErrStatus {
NO_ERROR(0), FILE_ERROR(1), MEMORY_ERROR(2);
private final int statusCode;
private ErrStatus(int statusCode) {
this.statusCode = statusCode;
}
@Override
public String toString() {
return Integer.toString(statusCode);
@skRyo
skRyo / gist:3196957
Created July 29, 2012 09:19
教えてエライ人2
interface Debugprintable {
public static int NO_ERROR = 0;
public static int FILE_ERROR = 1;
public static int MEMORY_ERROR = 2;
public static String PREFIX = "ERROR:";
void debugprint();
}
public class Mynumber implements Debugprintable{
@skRyo
skRyo / gist:3175775
Created July 25, 2012 11:56
教えてエライ人
interface Debugprintable {
void debugprint();
}
public class mynumber implements Debugprintable{
private int a;
public mynumber(int a) {
this.a = a;
@skRyo
skRyo / gregoriano.java
Created July 11, 2012 10:53
グレゴリオ的な
/*
* 西暦年が4で割り切れる年は閏年
ただし、西暦年が100で割り切れる年は平年
ただし、西暦年が400で割り切れる年は閏年
*
*/
public class gregoriano {
public static void main(String[] args) {
int x = 1000;
@skRyo
skRyo / fizzbuzz.java
Created July 11, 2012 10:01
fizzbuzz
import java.io.*;
public class fizzbuzz {
public static void main(String[] args) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
String line = reader.readLine();
int x = Integer.parseInt(line);