复制粘贴吧 关注:194,536贴子:1,594,212
  • 5回复贴,共1

import java.util.Scanner; pu

只看楼主收藏回复

import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[][] arr =new int[n][n];
int q = 1;
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
arr[i][j] = q;
q++;
}
}
for(int i = 0; i < n; i++) {
if(i%2!=0) {
for(int j = 0; j < n/2-1; j++) {
int desk = 0;
desk = arr[i][j];
arr[i][j] = arr[i][n-j];
arr[i][n-j] = desk;
}
}
}
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
System.out.print(arr[i][j]);
}
System.out.println();
}
sc.close();
}
}


IP属地:北京来自Android客户端1楼2023-11-12 23:31回复

    #include <stdio.h>
    int main() {
    int k;
    scanf("%d", &k);
    for (int i = 0; i <= k; i++) {
    int a;
    scanf("%d", &a);
    if (a == 1) {
    printf("1\n");
    } else {
    printf("%d\n", (a - 1) * 4);
    }
    }
    return 0;
    }


    IP属地:北京来自Android客户端2楼2023-11-12 23:31
    回复
      import java.util.Scanner;
      public class Main {
      public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int k = sc.nextInt();
      for(int i = 0; i <= k; i++) {
      int a = sc.nextInt();
      if(a==1) System.out.println("1");
      else System.out.println((a-1)*4);
      }
      sc.close();
      }
      }转为c语言


      IP属地:北京来自Android客户端3楼2023-11-12 23:31
      回复
        是谁闯进了
        这一座没有尽头的迷宫
        星星在凋落
        快去寻找命运的出口
        Take care
        听见玫瑰的蛊惑
        Watch out
        解开小丑的枷锁
        Heads up
        掌控你的人就是我
        你再也无法逃脱
        Listen to my heart
        回应我的期许 陪我玩到底
        谁能出其不意
        Be a secret player
        上演一出好戏 别问我意义
        在故事的结局
        Be a secret dreamer
        Secret player
        看我眼神说话 陪我一起玩耍
        Secret dreamer
        相信我的魔法 别问梦的真假
        在我的游戏里要享受甜蜜


        IP属地:福建来自iPhone客户端4楼2023-11-13 18:28
        回复
          □□□□,□□《□□》□□□□□□□□□□□□□□□□□□□□□□□□。□□□□□□□□□□「□□□」□□□□□,□□□,□□□□□□□□□□「□□□」,□□□□□□。□□□□□□□□「□□□」□□□□□,□□□□□□□□□□□□□、□□□□□□□□,□□□□□□□□□,□□□□□□□——□□,□□□□「□□」□□□


          IP属地:北京来自Android客户端5楼2023-11-14 07:38
          回复


            IP属地:广东来自iPhone客户端6楼2024-03-13 15:33
            回复