Skip to content

Instantly share code, notes, and snippets.

@makaliuk
Created October 28, 2016 20:39
Show Gist options
  • Save makaliuk/7e9c812b55cb3775e1a84ed3aacbaede to your computer and use it in GitHub Desktop.
Save makaliuk/7e9c812b55cb3775e1a84ed3aacbaede to your computer and use it in GitHub Desktop.
class normal {
public static void main (String[] args){
int a=40,b=45;
System.out.println("Ploscha pramokutnogo trikutnika "
+ a+" и "+ b+ " равна " +(a*b)/2);
double c=Math.sqrt(a*a+b*b);
System.out.println("Perimetr pramokutnogo trikutnika "
+ a+" и "+ b+ " gipotuneza " + (float) c+" rovno " +(float)(a+b+c));
}
}
package com.company;
public class Main {
public static void main(String... args){
for(int i = 1; i < 11; i++){
for(int k = 1; k < 11; k++){
System.out.print(k * i + " *");
}
System.out.println("");
}
}}
package com.company;
public class Main {
public static void main(String[] args) {
System.out.println("Цикл while");
int i = - 11;
while (i++ < 25) {
System.out.print(i + ", ");
}
System.out.println(" ");
System.out.println("Цикл do while");
int k = - 10;
do {
System.out.print(k + ", ");} while(k++ < 25);
System.out.println(" ");
System.out.println("Цикл For");
int c = -10;
for (c = -10; c < 26; c++){
System.out.print(c + ", ");
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment