Java Escape Cuidíonn uirlis Unescape leat éalú agus Unescape Java teaghrán nuair is mian leat a aschur an Java go díreach nach léirmhíniú ag brabhsálaí.
Conas Java a Éalú / a dhí-éalú?
- Chun do chuid sonraí Java a Éalú/Dí-éalú cuir leis/cóipeáil agus greamaigh na sonraí Java isteach san ionchur.
- Is féidir leat na sonraí Java a luchtú ón url freisin trí chliceáil ar an gcnaipe nó na sonraí Java a luchtú ón ríomhaire trí chliceáil ar an gcnaipe.
- Cliceáil ar an gcnaipe 'Escape' nó 'Unescape' chun na sonraí a phróiseáil.
- Nuair atá an comhshó déanta is féidir leat an comhad a íoslódáil trí chliceáil ar an gcnaipe.
Sonraí Ionchuir
public static void main(String[] args) {
System.out.println("length array: ");
Scanner sn = new Scanner(System.in);
int n = sn.nextInt();
int[] a = new int[n];
for (int i = 0; i < n; i++) {
System.out.println("Enter a[" + i + "]:");
a[i] = sn.nextInt();
}
System.out.println("");
for (int i = 0; i < n ; i++) {
System.out.print(a[i] + " ");
}
System.out.println("");
int j = 0;
for (int i = 0; i < n / 2; i++) {
if (a[i] == a[n - 1 - i]) {
j++;
}
}
if (j == n/2) {
System.out.println("Array");
} else {
System.out.println("Array");
}
}
Tar éis Éalú
public static void main(String[] args) {\r\n System.out.println(\"length array: \");\r\n Scanner sn = new Scanner(System.in);\r\n int n = sn.nextInt();\r\n int[] a = new int[n];\r\n for (int i = 0; i < n; i++) {\r\n System.out.println(\"Enter a[\" + i + \"]:\");\r\n a[i] = sn.nextInt();\r\n }\r\n \r\n System.out.println(\"\");\r\n for (int i = 0; i < n ; i++) {\r\n System.out.print(a[i] + \" \");\r\n }\r\n System.out.println(\"\");\r\n int j = 0;\r\n for (int i = 0; i < n / 2; i++) {\r\n if (a[i] == a[n - 1 - i]) {\r\n j++;\r\n }\r\n }\r\n if (j == n/2) {\r\n System.out.println(\"Array\");\r\n } else {\r\n System.out.println(\"Array\");\r\n }\r\n }