![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
计数基础
文章平均质量分 58
꧁ꦿ眠羊꧂
既然选择了远方,便只顾风雨兼程
展开
-
一些特殊矩阵
螺旋方阵 (20 分) 所谓“螺旋方阵”,是指对任意给定的N,将1到N×N的数字从左上角第1个格子开始,按顺时针螺旋方向顺序填入N×N的方阵里。本题要求构造这样的螺旋方阵。 输入格式: 输入在一行中给出一个正整数N(<10)。 输出格式: 输出N×N的螺旋方阵。每行N个数字,每个数字占3位。 输入样例: 5 输出样例: 1 2 3 4 5 16 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9 原文链接:https://blog.csdn.原创 2022-04-22 16:50:44 · 871 阅读 · 0 评论 -
天梯赛补题
7-1 出生年 (15 分) 前边需要补0的注意:1. 使用%04d;2. 使用数组计数但是不要用while,可以把4个数用除法和取模的方法求4位数。 数字相同不同的数量要用数组计数法。 #include <bits/stdc++.h> using namespace std; const int N = 3e3 + 7; int a[N]; int num[N]; int main() { int y, n; cin >> y >> n;原创 2022-04-15 19:16:50 · 551 阅读 · 0 评论 -
Janitor Troubles
给定四个边,求所构成的四边形的最大面积用海伦公式 While working a night shift at the university as a janitor, you absentmindedly erase a blackboard covered with equations, only to realize afterwards that these were no ordinary equations! They were the notes of the venerableProfe.原创 2022-04-06 21:29:25 · 88 阅读 · 0 评论 -
特殊计数方法
1. PTA-帅到没朋友 链接:帅到没朋友 代码 #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 7; int a[N]; int main() { int n, m; cin >> n; memset(a, 0, sizeof(a)); int x; while(n --) { cin >> m;原创 2022-03-24 16:56:58 · 113 阅读 · 0 评论