4 条题解
-
0何辰恩 (hechenen1) LV 8 @ 2024-2-18 21:04:35
#include <queue> #include <math.h> #include <stack> #include <vector> #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> #include <string.h> #include<cstring> #include <algorithm> #define LL long long const int N=1e2+10; const int INF = 0x3f3f3f3f; using namespace std; int n,i,j,a[N][N]; int main(int argc,char const*argv[]) { cin>>n; int s=1; int k=n; i=n-1; j=0; int s1=0,s2; while(k){ k--; while(i<=n-1){ a[i][j]=s; s1=i; i++,j++; s++; } i=k; i--; j=0; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(a[i][j]!=0){ printf("%4d",a[i][j]); } } printf("\n"); } return 0; }
其他题解好像都在Ctrl大佬的呀(除某V10dalao)bushi我
-
-12024-1-30 11:25:29@
#include<stdio.h> int main(int argc,char const*argv[]) { int n,i,j,a[100][100]={0}; scanf("%d",&n); int s=1; int k=n; i=n-1; j=0; int s1=0,s2; while(k) { k--; while(i<=n-1) { a[i][j]=s; s1=i; i++,j++; s++; } i=k; i--;j=0; } for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(a[i][j]!=0) printf("%4d",a[i][j]); } printf("\n"); } }
-
-12023-10-28 11:32:00@
-
-12023-7-9 9:29:55@
#include<stdio.h> int main(int argc,char const*argv[]) { int n,i,j,a[100][100]={0}; scanf("%d",&n); int s=1; int k=n; i=n-1; j=0; int s1=0,s2; while(k) { k--; while(i<=n-1) { a[i][j]=s; s1=i; i++,j++; s++; } i=k; i--;j=0; } for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(a[i][j]!=0) printf("%4d",a[i][j]); } printf("\n"); } }
- 1
信息
- ID
- 1075
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 6
- 标签
- 递交数
- 303
- 已通过
- 93
- 上传者