Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class aceitararray10oumenos {
- static int []tab;
- public static void main(String[] args){
- tab=new int [10];
- int notas,contador, melhor,i;
- notas=0;
- contador=0;
- melhor=0;
- Scanner leitor;
- leitor=new Scanner(System.in);
- for (i=0; i<10; i=i+1){
- while(contador<10){
- System.out.print("Introduza as notas:");
- tab[i]=leitor.nextInt();
- if (tab[i]==999){
- tab[i]=0;
- }
- if (tab[i]>=melhor){
- melhor=tab[i];
- }
- contador=contador+1;
- } }
- System.out.println("Melhor nota:" + melhor);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement