Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.43 KB | None | 0 0
  1.  
  2. import java.io.File;
  3. import java.io.FileNotFoundException;
  4. import java.io.PrintWriter;
  5. import java.util.Scanner;
  6.  
  7. /**
  8.  *
  9.  * @author =v
  10.  */
  11. public class main {
  12.     public static void main (String[] args){
  13.         Scanner sc = null;
  14.         PrintWriter pw = null;
  15.         try {
  16.             pw = new PrintWriter("OUT4.txt");
  17.             sc = new Scanner(new File("DATA4.txt"));
  18.         } catch (FileNotFoundException ex) {
  19.         }
  20.         int num, count = 0;
  21.         for (int i = 0; i < 5; i++){
  22.             num = Integer.parseInt(sc.next());
  23.             int[] x = new int[num];
  24.             int[] y = new int[num];
  25.             for (int j = 0; j < num; j++){
  26.                 x[j] = Integer.parseInt(sc.next());
  27.                 y[j] = Integer.parseInt(sc.next());
  28.             }
  29.             for (int j = 0; j < num; j++){
  30.                 for (int k = j + 1; k < num - 1; k++){
  31.                     for (int l = k+ 1; l < num - 2; l++){
  32.                         if ((x[j] > 0 && x[k] > 0 && x[l] > 0) || (x[j] < 0 && x[k] < 0 && x[l] < 0)){
  33.  
  34.                         } else if (((y[j] > 0 && y[k] > 0 && y[l] > 0))
  35.                                 || y[j] < 0 && y[k] < 0 && y[l] < 0){
  36.                         } else {
  37.                             count++;
  38.                         }
  39.                     }
  40.                 }
  41.             }
  42.             pw.println(count);
  43.         }
  44.         pw.close();
  45.         sc.close();
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement