Advertisement
michael_xgrind

p

Oct 19th, 2014
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. public class Teste {
  2.     public static void main(String args[]){
  3.         String vogais = "aeiouAEIOU";
  4.         int total = 0;
  5.        
  6.         String palavra = "Programacao";
  7.        
  8.         for(int i=0; i<5; i++){
  9.             for(int j=0; j<i; j++){
  10.                 if(palavra.substring(i,i+1).equals(vogais.substring(j,j+1))) { 
  11.                     total++;
  12.                 }
  13.             }
  14.         }
  15.        
  16.         System.out.print("\nTotal: " + total);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement