Cezar usilinda shifrlaw


Download 36.13 Kb.
Sana10.11.2021
Hajmi36.13 Kb.
#172896
Bog'liq
kiber ameliy


CEZAR USILINDA SHIFRLAW

Java programmalastiriw tilinde jazilg’an kodi:

package cezar;

import java.util.Scanner;

public class Cezar {

public static void main(String[] args) {

System.out.println("CEZAR USILINDA SHIFRLAW");

Scanner in=new Scanner(System.in);

String s; int n;

System.out.print("Tekstti kiritin' : "); s=in.next();

System.out.print("Gilt sandi kiritin' : "); n=in.nextInt();

if(n>=3){ for(int i=0; i

if((char)(n+(int)s.charAt(i))>64 && (char)(n+(int)s.charAt(i))<90

|| (char)(n+(int)s.charAt(i))>97 && (char)(n+(int)s.charAt(i))<123){

System.out.print((char)(n+(int)s.charAt(i)));}

else if(s.charAt(i)<=90)

System.out.print((char)(n+(int)s.charAt(i)-26));

else if(s.charAt(i)<=122)

System.out.print((char)(n+(int)s.charAt(i)-26)); } }

else System.out.print("U'lkenirek gilt kiritin' : ");

System.out.println();



} }

Java programmalastiriw tilinde aling’an na’tiyje :



CEZAR USILINDA DESHIFRLAW

Java programmalastiriw tilinde jazilg’an kodi:

package cezardeshifr;

import java.util.Scanner;

public class Cezardeshifr {

public static void main(String[] args) {

System.out.println("CEZAR USILINDA DESHIFRLAW");

Scanner in=new Scanner(System.in);

String s; int n,b=0;

System.out.print("Tekstti kiritin' : "); s=in.next();

System.out.print("Gilt sandi kiritin' : "); n=in.nextInt();

if(n>=3){ for(int i=0; i

if((int)s.charAt(i)-n < 97)

b=(int)s.charAt(i)+23-n;

else b=(int)s.charAt(i)-n;

System.out.print((char)b);}}

else { System.out.println("U'lkenirek gilt kiritin' : ");}

System.out.println();

} }


Java programmalastiriw tilinde aling’an na’tiyje :



TUWRIDAN TUWRI ORIN ALMASTIRIW USILINDA SHIFRLAW

Java programmalastiriw tilinde jazilg’an kodi:

package kiber;

import java.util.Scanner;

public class Kiber {

public static void main(String[] args) {

Scanner in=new Scanner(System.in);

String d,e;

System.out.println("Tuwridan tuwri orin almastiriw usilinda "

+ "shifrlaw");

int a, b, c, g=0, h=0;

System.out.print("Tekstti kiritin' : ");

System.out.println("!!!Tekst ha'riplerinin' sani jup sannan ibarat bolsin");

d=in.nextLine();

System.out.print("Ko'beymesi tekst ha'riplerinin' "

+ "sanina ten' bolg'an eki o'lshem kiritin' : ");

a=in.nextInt(); b=in.nextInt();

System.out.println("x = {"+a+","+b+"}");

for(int i=0; i

System.out.print((char)(g)); }

for(int j=1; j

if(a>=3)

for(int l=2; l

{ System.out.print(d.charAt(l));}

if(a>=4) { for(int q=3; q

{ System.out.print(d.charAt(q)); } }

if(a>=5) { for(int q=4; q

{ System.out.print(d.charAt(q)); } }

System.out.println(); }}



Java programmalastiriw tilinde aling’an na’tiyje :



TUWRIDAN TUWRI ORIN ALMASTIRIW USILINDA DESHIFRLAW

Java programmalastiriw tilinde jazilg’an kodi:

package kiberr;

import java.util.Scanner;

public class Kiberr {

public static void main(String[] args) {

Scanner in=new Scanner(System.in);

String d,e;

System.out.println("Tuwridan tuwri orin almastiriw"

+ " usilinda deshifrlaw");

int a, b, c, g=0, h=0;

System.out.print("Shifrtekstti kiritin' : "); d=in.nextLine();

System.out.print("Shifrlaniwda kiritilgen o'lshemlerdi orin "

+ "almastirip kiritin' : "); a=in.nextInt(); b=in.nextInt();

System.out.println("x = {"+a+","+b+"}");

for(int i=0; i

System.out.print((char)(g)); }

for(int j=1; j

if(a>=3)

for(int l=2; l

{ System.out.print(d.charAt(l));}

if(a>=4) { for(int q=3; q

{ System.out.print(d.charAt(q)); } }

if(a>=5) { for(int q=4; q

{ System.out.print(d.charAt(q)); } }



System.out.println(); }}

Java programmalastiriw tilinde aling’an na’tiyje :


Download 36.13 Kb.

Do'stlaringiz bilan baham:




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