Skip to content

Instantly share code, notes, and snippets.

public class Main {
static Strauss strauss;
static Vorobei vorobei;
public static void main(String[] args) {
Strauss strauss = new Strauss();
Strauss.dvijenie = "Бегу";
strauss.dvijenie();
Vorobei vorobei = new Vorobei();
@greensma
greensma / Task1.java
Created November 27, 2016 18:47
HomeWork7
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.Reader;
public class Task1 {
public static void main(String[] args) throws IOException {
File file = new File("D:/test-java.txt");
file.createNewFile();
@greensma
greensma / HW3Ex1.java
Created October 28, 2016 20:06
HomeWork3
public class Ex1 {
public static void main(String[] args) {
System.out.printf("Площадь %.2f",geroneSquare(14, 12, 12));
}
public static double geroneSquare(double a, double b, double c) {
double p = (a + b + c) / 2;
@greensma
greensma / Ex6.java
Last active October 24, 2016 14:54
Home work #2
public class Ex6 {
public static void main(String... args){
for(int i = 1; i < 10; i++){
for(int k = 1; k < 10; k++){
System.out.print(k * i + " ");
}
System.out.println("");
}
}
}
@greensma
greensma / Ex5.java
Last active October 24, 2016 14:54
Home work #2 Смаглюк Иван
public class Ex5 {
public static void main(String[] args) {
for (int i = 1; i <=15; i++) {
if (i % 3 == 0)
System.out.print(i + " ");
}
}
}
@greensma
greensma / Ex4.java
Last active October 24, 2016 14:53
Home work #2 Иван Смаглюк
public class Ex4 {
public static void main(String[] args) {
for (int i = 0; i <= 20; i = i + 2) {
System.out.print(i + " ");
}
}
}
@greensma
greensma / Ex3.java
Last active October 24, 2016 14:52
Home work #2 Смаглюк Иван
public class Ex3 {
public static void main(String[] args) {
for (int i = 10; i >= 0; i = i - 2) {
System.out.print(i + " ");
}
}
}
@greensma
greensma / Ex2.java
Last active October 24, 2016 14:52
Home work #2 Иван Смаглюк
class Ex2 {
public static void main(String[] args) {
String s = ("I will adopt best practices ");
for (int i = 0; i < 7; i++) {
System.out.println(s);
}
}
}
@greensma
greensma / Ex1.java
Last active October 24, 2016 14:50
Home work #2 Иван Смаглюк
class Ex1 {
public static void main(String args[]) {
int a = 4;
if((a % 2) == 0)
System.out.println(" is Even number" + a);
else
System.out.println(" is Odd number" + a );
}