This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import javax.swing.*; | |
import java.lang.Math.*; | |
import java.text.*; | |
class Eqn2 { | |
public static void Solve(int a, int b, int c) { | |
double delta = b*b-(4*a*c); | |
if (delta < 0) { | |
System.out.println("No solution !"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import javax.swing.*; | |
class Height { | |
public static void main(String[] args) { | |
JFrame myFrame = new JFrame(); | |
myFrame.setSize(500, 300); | |
myFrame.setTitle("Ung dung do chieu cao cua ban "); | |
myFrame.setVisible(true); | |
myFrame.getIconImage(); | |
String str = JOptionPane.showInputDialog(myFrame, "Nhap vao chieu cao cua ban (cm) : "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Chuong trinh tim so lon nhat va so be nhat tao thanh tu 2 so nguyen 2 chu so | |
import javax.swing.*; | |
import java.util.*; | |
class MinMax { | |
public static void swapFunction(int[] a, int n) { // Initialising the Array Swapping Function | |
for (int i = 0; i < n; i++) { | |
for (int j = (i+1); j < n; j++) { | |
if (a[i] > a[j]) { | |
int temp = a[i]; | |
a[i] = a[j]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import javax.swing.*; | |
class SpellInt { // Class init | |
public static void Spell(int n) { | |
String str1, str2, str3, str4; | |
str1 = "ngan"; | |
str2 = "tram"; | |
str3 = "chuc"; | |
str4 = "don vi"; | |
int x, y, j, k; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
//import javax.swing.*; | |
class Square{ | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
System.out.println("Nhap vao so n : "); | |
int n = scan.nextInt(); | |
for (int i = 0; i <= n; i++) { | |
for (int j = i; j<=(n-1); j++ ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
class Student { // Initialising the main class | |
int studentage; | |
public Student(String name) { | |
System.out.println("Name choosen is : " + name); | |
} | |
public void setAge(int age) { | |
studentage = age; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
class Backsee{ | |
public static void Process(int a){ | |
int x; | |
for (int i = 10; i <= a;){ | |
x = a%i; | |
a = a/i; | |
System.out.print(x); | |
} | |
System.out.print(a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void Process(int a){ | |
int n; | |
for (int i = 10; i <=a;){ | |
a = a/10; | |
} | |
printf("Chu so dau tien cua so a la : %d ", a); | |
} | |
void main() { | |
int a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
void CheckSST(float a, float b, float c) { | |
float aceil = ceilf(a*a*10)/10; | |
float bceil = ceilf(b*b*10)/10; | |
float cceil = ceilf(c*c*10)/10; | |
if (a==b && ceilf((a*a+b*b)*10)/10 == cceil) { | |
printf("Passed !\n"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Ham.h" | |
int CheckLeap(int year){ | |
int leap; | |
if (year % 4 == 0 || (year % 4 == 0 && year % 100 != 0)) leap = 1; | |
else leap = 0; | |
return leap; | |
} | |
int DayInMonth(int month, int year){ | |
int nday; | |
switch (month) |
OlderNewer