/*
* triangulosuma.java
*
* Created on 23 de noviembre de 2010, 03:36 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package archivo;
import java.io.*;
import java.util.*;
/**
*
* @author Ari
*/
public class triangulosuma
{
/** Creates a new instance of triangulosuma */
public static void main(String[]args) throws FileNotFoundException, IOException
{
Scanner sn = new Scanner(new File("in1.txt"));
FileOutputStream fos = new FileOutputStream("out1.txt");
PrintStream ps = new PrintStream(fos);
int n=sn.nextInt();
int m[][]=new int [n][n];
for(int i=0;i<=n-1;i++)
{for (int j=0;j<=n-1;j++)
{
m[i][j]=sn.nextInt();
}
}
int menor= m[1][0]; //2
int aux;
for(int i=n-1;i<=n-1;i++) //2
{
for (int j=0;j<=1;j++) //0
{
aux=m[i][j]; //1
if(menor>aux) // compara 2>1
menor=aux; // menor:1
}
}
System.out.println(menor);
}
}
No hay comentarios:
Publicar un comentario