Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class vestibular{
- public static void main(String[] args){
- Scanner tecla = new Scanner(System.in);
- int quantidadeDeQuestoes = tecla.nextInt();
- String gabarito = tecla.next();
- String resposta = tecla.next();
- int total = 0;
- char[] letras = gabarito.toCharArray();
- char[] respostas = resposta.toCharArray();
- for(int g = 0; g < quantidadeDeQuestoes; g++){
- if(letras[g] == (respostas[g])){
- total++;
- }
- }// FEITO POR WALEX!
- System.out.println(total);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement