Add Java file test

This commit is contained in:
Mithil Poojary 2020-10-05 05:23:51 +05:30 committed by David Peter
parent bbf6ec0458
commit 5fa1645165
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,39 @@
import java.util.Scanner;
/* This Java program was submiited to help bat
 * with its syntax highlighting tests
 */
public class Main
{
 public static void main(String[] arg)
 {
 Scanner st = new Scanner(System.in);
 int t;
 t = st.nextInt();
 String tem;
 tem = st.nextLine();
 for(int zz=0;zz<t;zz++)
 {
 String str;
 str = st.nextLine();
 int n = str.length();
 char ch;
 for(int i=0;i<n;i++)
 {
 ch = str.charAt(i);
 if(ch=='a')
 System.out.print("n");
 else if(ch=='s')
 System.out.print("i");
 else
 System.out.print(ch);
 }
 System.out.println();
 }
 while(t!=0) {
 // Decrement t
 t -= 1;
 }
 }
}

View File

@ -0,0 +1,39 @@
import java.util.Scanner;
/* This Java program was submiited to help bat
* with its syntax highlighting tests
*/
public class Main
{
public static void main(String[] arg)
{
Scanner st = new Scanner(System.in);
int t;
t = st.nextInt();
String tem;
tem = st.nextLine();
for(int zz=0;zz<t;zz++)
{
String str;
str = st.nextLine();
int n = str.length();
char ch;
for(int i=0;i<n;i++)
{
ch = str.charAt(i);
if(ch=='a')
System.out.print("n");
else if(ch=='s')
System.out.print("i");
else
System.out.print(ch);
}
System.out.println();
}
while(t!=0) {
// Decrement t
t -= 1;
}
}
}