Created
November 4, 2015 13:12
-
-
Save valchaqui/fe5e5c27e59897b6c280 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class nomes { | |
public static void main(String [] x) { | |
String nome; | |
String b = "marcelo"; | |
int i, marcelo=0, novo; | |
Scanner ler = new Scanner(System.in); | |
for(i=0;i<10;i++){ | |
System.out.print("Digite o "+(i+1)+".o nome: "); | |
nome = ler.nextLine(); | |
if(nome.equals(b)){ | |
marcelo++; | |
} | |
} | |
novo=marcelo++; | |
System.out.print("\n\nExistem "+novo+" nomes -MARCELO- digitados"); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment