NobleFire

1247

Lin_Yinjia
Expelliarmus2011

mayu666

tyjz_yyds

Jack404

AcWing2AK
V1
WangJY
zztt

slight
cdm

NobleFire
5小时前
import java.util.*;

public class Main{
public static void main(String[] args){
Scanner cin = new Scanner(System.in);
int n = cin.nextInt();
int m = cin.nextInt();
int q[][] = new int [n][m];
int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
int l = 1;
for(int k = 1, i = 0, j = 0; k <= n * m; k ++){
q[i][j] = k;
int x = i + dx[l], y = j + dy[l];
if(x < 0 || x >= n || y < 0 || y >= m || q[x][y] != 0){
l = (l + 1) % 4;
x = i + dx[l]; y = j + dy[l];
}
i = x; j = y;
}
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++)
System.out.print(q[i][j] + " ");
System.out.println(" ");
}
}
}

NobleFire
6小时前
import java.util.*;

public class Main{
public static void main(String[] args){
Scanner cin = new Scanner(System.in);
char op = cin.next().charAt(0);
double sum = 0;
for(int j = 0; j < 12; j ++)
for(int k = 0; k < 12; k ++){
double x = cin.nextDouble();
if(k < 12 - j - 1) sum += x;
}
if(op == 'S') System.out.printf("%.1f", sum);
else System.out.printf("%.1f", sum / 66);
}
}

NobleFire
6小时前

#### java 代码

import java.util.*;

public class Main{
public static void main(String[] args){
Scanner cin = new Scanner(System.in);
int q[][] = new int [105][105];
for(int n = 0; n < 105; n++){
int x = cin.nextInt();
if(x == 0) break;
for(int m = 0; m <= x / 2; m ++)
for(int j = m; j < x - m; j ++)
for(int k = m; k < x - m; k ++)
q[j][k] = m + 1;
for(int i = 0; i < x; i++){
for(int j = 0; j < x; j++)
System.out.printf("%d ", q[i][j]);
System.out.println("");
}
System.out.println("");
}
}
}

NobleFire
6小时前
import java.util.*;

public class Main{
public static void main(String[] args){
Scanner cin = new Scanner(System.in);
int q[][] = new int [105][105];
for(int n = 0; n < 105; n++){
int x = cin.nextInt();
if(x == 0) break;
for(int m = 0; m <= x / 2; m ++)
for(int j = m; j < x - m; j ++)
for(int k = m; k < x - m; k ++)
q[j][k] = m + 1;
for(int i = 0; i < x; i++){
for(int j = 0; j < x; j++)
System.out.printf("%d ", q[i][j]);
System.out.println("");
}
System.out.println("");
}
}
}

NobleFire
16小时前
import java.util.*;
public class Main{
public static void main(String[] arg) {
Scanner cin = new Scanner(System.in);
double q[][] = new double[12][12];
int l = cin.nextInt();
String s = cin.next();
for(int i = 0; i < 12; i ++) {
for(int j = 0; j < 12; j++){
q[i][j] = cin.nextDouble();
}
}
double y = 0;
for(int i = 0; i < 12; i++)  y += q[l][i];
if(s.equals("S"))  System.out.printf("%.1f",y);
else  System.out.printf("%.1f",y/12);
}
}

NobleFire
18小时前
import java.util.*;
public class Main{
public static void main(String[] arg){
Scanner cin = new Scanner(System.in);
int q[] = new int[10];
for(int i = 0; i < 10; i ++) {
int x = cin.nextInt();
if(x <= 0) x = 1;
q[i] = x;
System.out.printf("X[%d] = %d\n", i, q[i]);
}
}
}

NobleFire
18小时前
import java.util.*;
public class Main{
public static void main(String[] arg){

for(int i = 2; i <= 100; i += 2)
System.out.println(i);

}
}

NobleFire
18小时前
import java.util.*;
public class Main{
public static void main(String[] arg){
Scanner cin = new Scanner(System.in);
int a = cin.nextInt();
int b = cin.nextInt();
if(a % b == 0 || b % a == 0) System.out.println("Sao Multiplos");
else System.out.println("Nao sao Multiplos");

}
}

NobleFire
20小时前
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1010;
int n, q[N];

int main()
{
cin >> n;
for (int i = 1; i <= n; i ++ ) cin >> q[i];
sort(q, q + 1 + n);
for (int i = 1; i <= n; i ++ )
if(q[i] != q[i - 1])  cout << q[i] << " ";
return 0;
}

import java.util.*;

public class Main{
public static void main(String[] arg){
Scanner cin = new Scanner(System.in);
int N = cin.nextInt();
System.out.println(N);
int q[] = {100, 50, 20, 10, 5, 2, 1};
for(int i = 0; i < 7; i ++){
System.out.printf("%d nota(s) de R\$ %d,00\n", N / q[i], q[i]);
N = N % q[i];
}
}
}