Tourist_4

183

Tourist_4
2小时前

Tourist_4
1个月前
import javax.swing.plaf.synth.SynthOptionPaneUI;
import java.util.Map;
import java.util.Scanner;

public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
while (sc.hasNext()) {
int n = sc.nextInt();
if(n==0)break;
solve(n);
System.out.println();
}
}
public  static  void solve(int n){
int a[][]=new int [n+1][n+1];
for(int k=1;k<=n;k++)
for(int i=k;i<=n-k+1;i++)
{
for(int j=k;j<=n-k+1;j++){
a[i][j]=k;
}
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++) System.out.printf("%d ",a[i][j]);
System.out.println();
}
}

}


Tourist_4
1个月前
import javax.swing.plaf.synth.SynthOptionPaneUI;
import java.util.Map;
import java.util.Scanner;

public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int t=n/2;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(Math.abs(i-t)+Math.abs(j-t)<=t)
System.out.printf("*");
else System.out.printf(" ");
}
System.out.println();
}
}

}


Tourist_4
1个月前
import javax.swing.plaf.synth.SynthOptionPaneUI;
import java.util.Map;
import java.util.Scanner;

public class Main
{
public static void main(String[] args) {
for(int i=1;i<=100;i++)
{
if((i&1)!=1) System.out.println(i);
}
}

}


Tourist_4
1个月前
import java.util.Scanner;

public class Main {
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

String a = sc.nextLine(), b = sc.nextLine(), c = sc.nextLine();

{
if(b.equals("ave"))
{
if(c.equals("carnivoro")) System.out.println("aguia");
else System.out.println("pomba");
}
else
{
if(c.equals("onivoro")) System.out.println("homem");
else System.out.println("vaca");
}
}
else
{
if(b.equals("inseto"))
{
if(c.equals("hematofago")) System.out.println("pulga");
else System.out.println("lagarta");
}
else
{
if(c.equals("hematofago")) System.out.println("sanguessuga");
else System.out.println("minhoca");
}
}
}
}


Tourist_4
1个月前
import javax.swing.plaf.synth.SynthOptionPaneUI;
import java.util.Map;
import java.util.Scanner;

public class Main
{
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int a= sc.nextInt();int b= sc.nextInt();
if(a==b) System.out.println("O JOGO DUROU 24 HORA(S)");
else{
if(a>b)
System.out.printf("O JOGO DUROU %d HORA(S)\n",Math.min((24-a+b),24));
else
System.out.printf("O JOGO DUROU %d HORA(S)\n",b-a);

}
}

}


Tourist_4
1个月前
import java.util.Scanner;

public class Main {
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

double n = sc.nextDouble();

if (n >= 0 && n <= 25) System.out.println("Intervalo [0,25]");
else if (n > 25 && n <= 50) System.out.println("Intervalo (25,50]");
else if (n > 50 && n <= 75) System.out.println("Intervalo (50,75]");
else if (n > 75 && n <= 100) System.out.println("Intervalo (75,100]");
else System.out.println("Fora de intervalo");

}
}



Tourist_4
1个月前
import java.util.Map;
import java.util.Scanner;

public class Main
{
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
double c[]=new double[]{4,4.5,5,2,1.5};
int a=sc.nextInt();a--;
int b=sc.nextInt();
System.out.printf("Total: R\$ %.2f",c[a]*b);
}

}


Tourist_4
1个月前
import java.util.Scanner;

public class Main
{
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int a=sc.nextInt();
int b= sc.nextInt();
if(a%b==0||b%a==0) System.out.println("Sao Multiplos");
else System.out.println("Nao sao Multiplos");
}

}