刚改完大家提交的Lab3,这里说一下Lab说出现的问题。
大多数同学的编程风格都非常得不好,虽然大家写得比较多了之后会慢慢好起来,但请大家从现在开始就养成一些好习惯。
乱打括号、胡乱空格空行的代码非常不利于大家debug,现在代码量比较小大家可能没体会,但当开始做pj会大家就会逐渐明白有一个良好的编程风格的重要性。与此同时,有一个良好的编程风格也是大家今后进入一流IT企业的必要基础,因为大多数IT巨头都很重视code review。
package lab3_2; | |
import java.util.Scanner; | |
public class Lab3_2 { | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
System.out.print("Please enter a number(positive interger): "); | |
int n = input.nextInt(); | |
System.out.println("Your input is:\n" + n); | |
while (n < 1) { |
@@ -19,12 +19,14 @@ public static void main(String[] args) { | |
spacebar += " "; | |
} | |
System.out.print(spacebar); | |
- for (int k = 1; k <= n-j+1; k++) { | |
+ for (int k = 1; k <= 2 * (n-j)+1; k++) { | |
star += "*"; | |
} | |
System.out.print(star); | |
System.out.println(); |
This is the notes of Introduction to Clojure.
In the REPL, at any time you can see the documentation for a given function:
(doc some-function)
-- | Zeqing Guo, August, 2015 | |
module Main where | |
class Fluffy f where | |
furry :: (a -> b) -> f a -> f b | |
-- Exercise 1 | |
-- Relative Difficulty: 1 | |
instance Fluffy [] where |
I hereby claim:
To claim this, I am signing this object: