This file contains hidden or 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
public class StepCount { | |
// 全ライン数 | |
private static int AllStep; | |
// 実コードライン数 | |
private static int CodeStep; | |
// コメントライン数 | |
private static int CommentStep; | |
// 空白ライン数 | |
private static int EmptyStep; | |
This file contains hidden or 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 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); |
This file contains hidden or 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 java.io.File; | |
public class Main { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
//解析対象ファイル |
This file contains hidden or 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
package com.example; | |
class Control { | |
//四角形の面積計算 | |
static int calcRectangle(Model m){ | |
return m.getWidth() * m.getHeight(); | |
} | |
//重なった四角形の頂点x計算 |
This file contains hidden or 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
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); |
This file contains hidden or 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
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{ |
This file contains hidden or 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
interface Debugprintable { | |
void debugprint(); | |
} | |
public class mynumber implements Debugprintable{ | |
private int a; | |
public mynumber(int a) { | |
this.a = a; |
This file contains hidden or 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
/* | |
* 西暦年が4で割り切れる年は閏年 | |
ただし、西暦年が100で割り切れる年は平年 | |
ただし、西暦年が400で割り切れる年は閏年 | |
* | |
*/ | |
public class gregoriano { | |
public static void main(String[] args) { | |
int x = 1000; |
This file contains hidden or 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 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); |