امروز سه شنبه ۱ خرداد ۱۴۰۳
دسته بندی سایت
محبوب ترین ها
پرفروش ترین ها
پر فروش ترین های فورکیا
برچسب های مهم
آمار بازدید سایت
پیوند ها
DrawStars
برنامه ای با خروجی ستاره به صورت زیر مثلا با ورود عدد 5 این گونه خروجی دهد:(مثلث قائم الزاويه با ستاره)
*****
****
***
**
*
import java.util.Scanner;
public class DrawStars {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int N = input.nextInt();
// for( int rownumber = 1 ; rownumber <= N ; rownumber++){
// for( int i = 0 ; i < rownumber ; i++)
// System.out.print("*");
// System.out.println();
//
// }
for( int rownumber = 0 ; rownumber < N ; rownumber++){
for( int i = 0 ; i <= rownumber ; i++){
System.out.print(" ");
}
System.out.println();
for (int i = 1; i <= N- rownumber; i++){
System.out.print("*");
}
System.out.println();
}}
}
برچسب های مهم
Multiplication( جدول ضرب در جاوا)
import javax.swing.JOptionPane;
import java.util.Scanner;
import java.math.BigInteger;
public class Multiplication {
public static void main(String[] args) {
System.out.println(" Multiplication Tale");
System.out.print(" ");
for (int i = 1; i <= 9; i++)
System.out.print(i+ " ");
System.out.println();
System.out.println(" ---------------------------------------");
for (int rowNum = 1; rowNum <= 9; rowNum++) {
System.out.print(rowNum+ " |");
for (int j = 1; j <= 9; j++) {
System.out.printf("%4d", rowNum * j);
}
System.out.println();
}
}
}
برچسب های مهم
تبدیل فارنهایت به سلسیوس در جاوا
FahrenheitToCelisius
import java.util.Scanner;
public class FahrenheitToCelisius {
public static void main(String[] args){
Scanner input = new Scanner (System.in);
System.out.println(" Enter a degree in Fahrenheit");
double Fahrenheit = input.nextDouble();
double Celsius = (5.0/9)*(Fahrenheit - 32);
System.out.println("Fahrenheit" + Fahrenheit + "is" +Celsius +"inCelisus");
}
}
برچسب های مهم
عدد قرینه بعد از عدد وارد شده
nextpalidrom Method
import java.util.Scanner;
public class nextpalidrome {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
System.out.println(nextpalidrom(n));
}
public static int nextpalidrom(int n) {
while(true){
n++;
if(palindrome.isPalindrome(n))
return n;
}
}
}
برچسب های مهم
آیا عددی که کاربر به عنوان ورودی وارد می کند قرینه است یا نه:
Palindrome Method
import java.util.Scanner;
public class palindrome {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
System.out.println(isPalindrome(n));
}
public static boolean isPalindrome(int n) {
int rev = reverse(n);
if (rev == n)
return true;
return false;
}
private static int reverse(int n) {
int rev = 0;
while ( n != 0){
rev = rev * 10 +(n%10);
n = n / 10;
}
return rev;
}
}
برچسب های مهم
Reverse Method
import java.util.Scanner;
public class Reverse {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
System.out.println(+reverse(n));}
public static int reverse(int n) {
int rev = 0;
while ( n != 0){
rev = rev * 10 +(n%10);
n = n / 10;
}
return rev;
}
}
برچسب های مهم
LCM Method
import java.util.Scanner;
public class LCM {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int a = input.nextInt();
int b = input.nextInt();
System.out.println("LCM (" +a+ ","+b+")=" +lcm(a,b));
}
public static int GCD(int a , int b) {
int r = a % b;
while ( r != 0){
a = b ;
b = r;
r = a%b;
}
return b;
}
private static int lcm(int a , int b) {
return a * b / GCD(a , b);
}
}
برچسب های مهم
GCD Method
import java.util.Scanner;
public class gcd {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int a = input.nextInt();
int b = input.nextInt();
System.out.println("GCD( " +a+ "," +b+ ")=" +GCD(a,b));
}
public static int GCD(int a , int b) {
int r = a % b;
while ( r != 0){
a = b ;
b = r;
r = a%b;
}
return b;
}
}
برچسب های مهم
Combination Method
import java.util.Scanner;
public class combination {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int r = input.nextInt();
System.out.println("c("+n+","+r+")="+com(n,r));
}
public static long fact(int n) {
int fact = 1;
for (int i = 2; i < n; i++) {
fact = fact * i;
}
return fact;
}
public static long com(int n , int r) {
long c = fact(n)/(fact(r)*fact(n-r));
return c;
}
}
Factorial Method
import java.util.Scanner;
public class fact {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
System.out.println(n+"!"+"="+fact(n));
}
public static long fact(int n) {
int fact = 1;
for (int i = 2; i < n; i++) {
fact = fact * i;
}
return fact;
}
}
فقط کافی است متد فاکتوریل را در محیط نت بینز انتقال دهید.
برچسب های مهم
کد الگوریتم متد توان با برنامه نویسی در محیط نت بینز
فقط کافی است کد را در محیط نت بینز کی، یست نمایید:
import java.util.Scanner;
public class power {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int a = input.nextInt();
int n = input.nextInt();
long pow = power(a,n);
System.out.println(a+"^" +n+ "="+pow);
}
public static long power(int a , int n) {
int pow = 1;
for (int i = 1; i <= n; i++)
pow *= a;
return pow;
}
}
برچسب های مهم
در اين پایان نامه، راه هاي نفوذ به شبكه هاي كامپيوتري و روش هاي مقابله با آنها معرفي مي گردد. به طور كلي روش هاي تشخيص نفوذ به تشخيص سوء استفاده و تشخيص رفتار غيرعادي تقسيم مي شوند. در روش هاي تشخيص سوء استفاده از الگوهاي نفوذ شناخته شده براي شناسايي نفوذها استفاده مي شود، در حالي كه در روش هاي تشخيص رفتار غيرعادي، رفتار عادي كاربران ملاك عمل قرار داده مي شود و در نتيجه هرگونه رفتار مغاير با آن تلاشي جهت نفوذ به سيستم شناسايي مي گردد.
سيستم هاي متعددي به منظور پياده سازي روش هاي تشخيص نفوذ ساخته شده اند كه براساس منبع اطلاعات دريافتي به دو دسته سيستم هاي تشخيص نفوذ مبتني بر ميزبان و سيستم هاي تشخيص نفوذ مبتني بر شبكه تقسيم مي شود. در اين مقاله براساس ارزيابي هاي انجام شده روي قوت، ميزان استقبال و جايگاه كاربردي روش ها، در هر بخش رهنمودهايي داده شده است.