Skip to content

Instantly share code, notes, and snippets.

@FreeFly19
FreeFly19 / Ex1
Last active October 23, 2016 21:45
Home work #2 Чуєнко Віталій
/**
* Created by Чуєнко Віталій on 19.10.2016.
*/
public class Ex1 {
public static void main(String[] args) {
int a = 4;
if (a % 2 == 0) {
System.out.println("even");
} else {
package com.company;
public class Home_2_T_1 {
public static void main(String[] args) {
int a = 8;
if (a%2==0) {
System.out.println("even");
} else {
@FreeFly19
FreeFly19 / Ex1.java
Last active October 23, 2016 21:59 — forked from ValdemarK/Ex1.java
Home work #2
package com.company;
public class Main {
public static void main(String[] args) {
int a = 4;
if(a % 2 == 0) {
System.out.println("even");
} else {
System.out.println("odd");
@FreeFly19
FreeFly19 / Ex1
Last active October 23, 2016 22:06
Home work #2
import java.util.Scanner;
public class Ex1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Введіть додатне число = ");
int a = in.nextInt();
@FreeFly19
FreeFly19 / 1
Last active October 23, 2016 22:12 — forked from makaliuk/1
Makaliuk Maxim 1
сложн ( ̄ー ̄)
@FreeFly19
FreeFly19 / Ex1.java
Last active October 23, 2016 22:15 — forked from greensma/Ex1.java
Home work #2 Иван Смаглюк
class Ex1 {
public static void main(String args[]) {
int a = 4;
System.out.print(a);
if (a % 2 == 0) {
System.out.println(" is Even number");
} else {
System.out.println(" is Odd number");
}
@FreeFly19
FreeFly19 / Ex2
Last active October 23, 2016 22:16 — forked from greensma/Ex2.java
Home work #2 Иван Смаглюк
class Ex2 {
public static void main(String[] args) {
final int COUNT = 7;
String s = "I will adopt best practices";
for (int i = 0; i < COUNT; i++) {
System.out.println(s);
}
}
}
@FreeFly19
FreeFly19 / Ex5.java
Last active October 23, 2016 22:18 — forked from greensma/Ex5.java
Home work #2 Смаглюк Иван
public class Ex5 {
public static void main(String[] args) {
int n = 15;
int m = 3;
for (int i = 1; i <= n; i++) {
if (i % m == 0) {
System.out.print(i + " ");
}
}
@FreeFly19
FreeFly19 / Ex6.java
Last active October 23, 2016 22:19 — forked from greensma/Ex6.java
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 + "\t");
}
System.out.println();
}
}
}
@FreeFly19
FreeFly19 / Ex1.java
Last active October 24, 2016 19:38
Class examples #3
public class Ex1 {
public static void main(String[] args) {
int[] arr = new int[3];
arr[0] = 1;
arr[1] = 423;
arr[2] = -32;
for(int i = 0; i < arr.length; i++) {
System.out.println(arr[i]);
}