bonjour
j'ai écrit ce programme
le but de mon programme est:
cryptographie par une substitution aléatoire,on utilise un alphabet-clé, dans lequel les lettres se succèdent de manière désordonnée;
exemple:
HYLUJPVREAKB...etc
A deviendront H, B deviendront Y etc...

la clé sera saisi par l'utilisateur

lors de compilations j'ai un message suivantes:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method contains(CharSequence) in the type String is not applicable for the arguments (String, String)
The method substring(int, int) in the type String is not applicable for the arguments (int, boolean, int)

at Divers4.main(Divers4.java:19)

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
import java.util.Scanner;
public class Divers4 
{	
 public static void main(String[] args) 
 {
	String bla,code,alpha;
	int i,decal;
	System.out.println("Entrez la phrase à coder:");
	Scanner sc=new Scanner(System.in);
	bla=sc.nextLine();
	System.out.println("Entrez l'alphabet clé:");
	int cle=sc.nextInt();
	alpha="abcdefghijklmnopqrstuvwxyz";
	code="";
	for(i=1;i<bla.length();i++)
	{
		String let=alpha.substring(i,1);
		boolean pos=alpha.contains(alpha,let);
		code = code & alpha.substring(cle,pos,1);	
	}
	bla=code;
	System.out.println("La phrase codée est:"+bla);
 }
}