016-L2-guruh talabasi yakubov zohidjon 4-labaratoriya ishi misol: 25000 dan kichik polindrom sonlarni ekranga chiqaruvchi dastur tuzing package



Download 23,78 Kb.
Sana31.12.2021
Hajmi23,78 Kb.
#212877
Bog'liq
4-LABARATORIYA ISHI


016-L2-guruh talabasi YAKUBOV ZOHIDJON

4-LABARATORIYA ISHI

Misol:25000 dan kichik polindrom sonlarni ekranga chiqaruvchi dastur tuzing.
package com.company;

public class Main {
public static int teskari(int n){
int m = 0, a;
while (n>0){
a = n%10;
n = n/10;
m = 10*m + a;
}
return m;}

public static void main(String[] args) {
for (int i = 11; i <= 25000; i++) {
if (i == teskari(i))
System.out.println(i);
}
}
}

Javob:


11 22 33 44 55 66 77 88 99 101 111 121 131 141 151 161 171 181 191 202 212 222 232 242 252 262 272 282 292 303 313 323 333 343 353 363 373 383 393 404 414 424 434 444 454 464 474 484 494 505 515 525 535 545 555 565 575 585 595 606 616 626 636 646 656 666 676 686 696 707 717 727 737 747 757 767 777 787 797 808 818 828 838 848 858 868 878 888 898 909 919 929 939
Misol:uchlari A(x,y),B(x1,y1),C(x2,y2),D(x3,y3) nuqtalarda bolgan togri turtburchak yasash mumkinmi?mumkin bolsa turi aniqlansin?

package com.company;
import java.util.Scanner;
import static java.lang.Math.*;
public class Main {
static void tekshir(int x,int y,int x1,int y1,int x2,int y2,int x3,int y3){
double a,b,c,e;
a=sqrt(pow((x1-x),2)+pow((y1-y),2));
b=sqrt(pow((x2-x1),2)+pow((y2-y1),2));
c=sqrt(pow((x3-x2),2)+pow((y3-y2),2));
e=sqrt(pow((x3-x),2)+pow((y3-y),2));
System.out.println("a= "+a+"\t"+"b= "+b+"\t"+"c= "+c+"\t"+"e= "+e+"\t");
if(a==b && b==c && c==e && ((x-x1)*(x1-x2)+(y-y1)*(y1-y2))/(a*b)==0)
System.out.println("Kvadrat");
if(a==e && b==c && e==c && ((x-x1)*(x1-x2)+(y-y1)*(y1-y2))/(a*b)!=0)
System.out.println("Romb");
if(((x-x1)*(x1-x2)+(y-y1)*(y1-y2))/(a*b)==0)
System.out.println("To'g'ri to'rt burchak");}
public static void main(String[] args) {
Scanner d=new Scanner(System.in);
int x,x1,x2,x3,y,y1,y2,y3;
System.out.print("x= "); x=d.nextInt();
System.out.print("y= "); y=d.nextInt();
System.out.print("x1= "); x1=d.nextInt();
System.out.print("y1= "); y1=d.nextInt();
System.out.print("x2= "); x2=d.nextInt();
System.out.print("y2= "); y2=d.nextInt();
System.out.print("x3= "); x3=d.nextInt();
System.out.print("y3= "); y3=d.nextInt();
tekshir(x,y,x1,y1,x2,y2,x3,y3);}}

javob:



Download 23,78 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish