@nabbit123/

Project#16a

Java

No description

fork
loading
Files
  • Main.java

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.858505102240952","path":"Main.java","file":{"path":"Main.java","content":{"asEncoding":{"base64":"Y2xhc3MgTWFpbiB7CiAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgaW50IGFycjFbXSA9IG5ldyBpbnRbMTBdOwogICAgaW50IGMseDsKICAgIFN5c3RlbS5vdXQucHJpbnRsbigiRmlyc3QgbGlzdCIpOwogICAgU3lzdGVtLm91dC5wcmludGxuKCJPcmlnaW5hbCBudW1iZXJzOiAiKTsKICAgIGZvcih4ID0gMDsgeCA8IDEwOyB4KyspewogICAgICBhcnIxW3hdID0gKGludCkgKDQwICogTWF0aC5yYW5kb20oKSArIDEpOwogICAgICBTeXN0ZW0ub3V0LnByaW50KGFycjFbeF0gKyAiICIpOwogICAgfQoKICAgIGZvcihjID0gMDsgYzwgKHggLSAxKTsgYysrKXsKICAgICAgZm9yKGludCBkID0gMDsgZCA8IHggLSBjIC0gMTsgZCsrKXsKICAgICAgICBpZihhcnIxW2RdID4gYXJyMVtkKzFdKXsKICAgICAgICAgIGludCBzd2FwID0gYXJyMVtkXTsKICAgICAgICAgIGFycjFbZF0gPSBhcnIxW2QrMV07CiAgICAgICAgICBhcnIxW2QrMV0gPSBzd2FwOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfQogICAgU3lzdGVtLm91dC5wcmludGxuKCIiKTsKICAgIFN5c3RlbS5vdXQucHJpbnRsbigiU29ydGVkIG51bWJlcnM6ICIpOwogICAgZm9yKGMgPSAwOyBjIDwgMTA7IGMrKyl7CiAgICAgIFN5c3RlbS5vdXQucHJpbnQoYXJyMVtjXSArICIgIik7CiAgICB9CgogICAgaW50IGFycjJbXSA9IG5ldyBpbnRbMTBdOwogICAgaW50IGMyLHgyOwogICAgU3lzdGVtLm91dC5wcmludGxuKCIiKTsKICAgIFN5c3RlbS5vdXQucHJpbnRsbigiIik7CiAgICBTeXN0ZW0ub3V0LnByaW50bG4oIlNlY29uZCBsaXN0Iik7CiAgICBTeXN0ZW0ub3V0LnByaW50bG4oIk9yaWdpbmFsIG51bWJlcnM6ICIpOwogICAgZm9yKHgyID0gMDsgeDIgPCAxMDsgeDIrKyl7CiAgICAgIGFycjJbeDJdID0gKGludCkgKDQwICogTWF0aC5yYW5kb20oKSArIDEpOwogICAgICBTeXN0ZW0ub3V0LnByaW50KGFycjJbeDJdICsgIiAiKTsKICAgIH0KCiAgICBmb3IoYzIgPSAwOyBjMjwgKHgyIC0gMSk7IGMyKyspewogICAgICBmb3IoaW50IGQyID0gMDsgZDIgPCB4MiAtIGMyIC0gMTsgZDIrKyl7CiAgICAgICAgaWYoYXJyMltkMl0gPiBhcnIyW2QyKzFdKXsKICAgICAgICAgIGludCBzd2FwMiA9IGFycjJbZDJdOwogICAgICAgICAgYXJyMltkMl0gPSBhcnIyW2QyKzFdOwogICAgICAgICAgYXJyMltkMisxXSA9IHN3YXAyOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfQogICAgU3lzdGVtLm91dC5wcmludGxuKCIiKTsKICAgIFN5c3RlbS5vdXQucHJpbnRsbigiU29ydGVkIG51bWJlcnM6ICIpOwogICAgZm9yKGMyID0gMDsgYzIgPCAxMDsgYzIrKyl7CiAgICAgIFN5c3RlbS5vdXQucHJpbnQoYXJyMltjMl0gKyAiICIpOwogICAgfQoKICAgIFN5c3RlbS5vdXQucHJpbnRmKCIlbiIpOwogICAgU3lzdGVtLm91dC5wcmludGYoIiVuIik7CiAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkFycmF5MzogIik7CiAgICBpbnQgYXJyM1tdPW5ldyBpbnRbMTBdOwogICAgZm9yKGludCByICA9IDA7IHIgPD0gOTsgcisrKXsKICAgICAgYXJyM1tyXSA9IGFycjFbcl0gKyBhcnIyW3JdOwogICAgICBTeXN0ZW0ub3V0LnByaW50KGFycjNbcl0gKyAiICIpOwogICAgfQogIH0KfQ=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class Main {
  public static void main(String[] args) {
    int arr1[] = new int[10];
    int c,x;
    System.out.println("First list");
    System.out.println("Original numbers: ");
    for(x = 0; x < 10; x++){
      arr1[x] = (int) (40 * Math.random() + 1);
      System.out.print(arr1[x] + " ");
    }

    for(c = 0; c< (x - 1); c++){
      for(int d = 0; d < x - c - 1; d++){
        if(arr1[d] > arr1[d+1]){
          int swap = arr1[d];
          arr1[d] = arr1[d+1];
          arr1[d+1] = swap;
          }
        }
      }
    System.out.println("");
    System.out.println("Sorted numbers: ");
    for(c = 0; c < 10; c++){
      System.out.print(arr1[c] + " ");
    }

    int arr2[] = new int[10];
    int c2,x2;
    System.out.println("");
    System.out.println("");
    System.out.println("Second list");
    System.out.println("Original numbers: ");
    for(x2 = 0; x2 < 10; x2++){
      arr2[x2] = (int) (40 * Math.random() + 1);
      System.out.print(arr2[x2] + " ");
    }

    for(c2 = 0; c2< (x2 - 1); c2++){
      for(int d2 = 0; d2 < x2 - c2 - 1; d2++){
        if(arr2[d2] > arr2[d2+1]){
          int swap2 = arr2[d2];
          arr2[d2] = arr2[d2+1];
          arr2[d2+1] = swap2;
          }
        }
      }
    System.out.println("");
    System.out.println("Sorted numbers: ");
    for(c2 = 0; c2 < 10; c2++){
      System.out.print(arr2[c2] + " ");
    }

    System.out.printf("%n");
    System.out.printf("%n");
    System.out.println("Array3: ");
    int arr3[]=new int[10];
    for(int r  = 0; r <= 9; r++){
      arr3[r] = arr1[r] + arr2[r];
      System.out.print(arr3[r] + " ");
    }
  }
}