SHARE
TWEET

Walexhenrique

a guest Jun 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. class vestibular{
  4.     public static void main(String[] args){
  5.         Scanner tecla = new Scanner(System.in);
  6.         int quantidadeDeQuestoes = tecla.nextInt();
  7.         String gabarito = tecla.next();
  8.         String resposta = tecla.next();
  9.         int total = 0;
  10.         char[] letras = gabarito.toCharArray();
  11.         char[] respostas = resposta.toCharArray();
  12.         for(int g = 0; g < quantidadeDeQuestoes; g++){
  13.             if(letras[g] == (respostas[g])){
  14.                 total++;
  15.             }
  16.         }// FEITO POR WALEX!
  17.         System.out.println(total);
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top