Skip to content

Instantly share code, notes, and snippets.

@ValdemarK
Last active October 31, 2016 14:32
Show Gist options
  • Save ValdemarK/236f4feacada71234194e2bfc4b63f97 to your computer and use it in GitHub Desktop.
Save ValdemarK/236f4feacada71234194e2bfc4b63f97 to your computer and use it in GitHub Desktop.
Home work #3
package com.company;
public class Main {
public static void main(String[] args) {
System.out.println(sum(3, 5));
}
static int sum(int a, int b) {
int s = (a * b)/2;
return s;
}
}
package com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
TabMn(I(),J());
}
static int I(){
Scanner in = new Scanner(System.in);
System.out.print("Введіть число: ");
int I = in.nextInt();
return I;
}
static int J(){
Scanner in = new Scanner(System.in);
System.out.print("Введіть друге число: ");
int J = in.nextInt();
return J;
}
static void TabMn(int Ia, int Jb){
for (int i = Ia; i != 0; i--) {
for (int j = Jb; j >= 1 ; j--) {
System.out.print(i*j);
System.out.print("\t");
}
System.out.println();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment