请问我的代码还需要什么

寻鱼仪
比赛题目
时间限制:C/C++ 1000MS,其他语言 2000MS
内存限制:C/C++ 256MB,其他语言 512MB
分数:100
描述

小星的爸爸非常喜欢钓鱼,买了一个智能的寻鱼装置——“寻鱼仪”,当发现一条鱼,它会发出警报。它使用深度读数来发出警报,但是小星的爸爸却不知道警报是什么意思,所以小星的爸爸设计了一个方案。

报警 n 次,连续的深度是一个上升趋势(例如3 4 7 9),这说明鱼在慢慢的向上游动,我们称之为 鱼上升

报警 n 次,连续的深度是一个下降趋势(例如9 6 5 2),这说明鱼在慢慢的向下游动,我们将称之为鱼潜水

报警 n 次,连续的深度是相同的,说明鱼没有移动,我们将称之为鱼静止。

如果是其他没有任何规律的数字,说明水里没有鱼。

虽然方案设计出来了,但是还是需要小星写好程序才能实现,现在来帮助一下小星吧。

输入描述

第一行输入 n(1<=n<=1000),表示报警的次数
第二行输入 n个数,a 表示深度

输出描述

输出是四种可能性之一。
如果深度读数在增加,那么输出应该是 鱼上升。
如果深度读数正在减少,那么输出应该是 鱼潜水。
如果深度读数相同,则输出应为 鱼静止。
没有鱼输出应为 没有鱼。

用例输入 1

4
30 10 20 20
用例输出 1

没有鱼


#include <iostream>
#include <vector>
using namespace std;
int main(){
    int n,x,y;
    cin>>n;
    for(i=1; i==n; i++){
        cin>>a;
        
    }
    return 0;
} 
#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n;
    cin >> n;

    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;

        vector<int> nums(a);
        for (int j = 0; j < a; j++) {
            cin >> nums[j];
        }

        bool increasing = true;
        bool decreasing = true;
        bool equal = true;
        for (int j = 1; j < a; j++) {
            if (nums[j] > nums[j - 1]) {
                decreasing = false;
                equal = false;
            } else if (nums[j] < nums[j - 1]) {
                increasing = false;
                equal = false;
            } else {
                increasing = false;
                decreasing = false;
            }
        }

        if (increasing) {
            cout << "鱼上升" << endl;
        } else if (decreasing) {
            cout << "鱼潜水" << endl;
        } else if (equal) {
            cout << "鱼静止" << endl;
        } else {
            cout << "没有鱼" << endl;
        }
    }

    return 0;
}

i==n是什麽目的呢???

#include <iostream>
#include <vector>
using namespace std;

int main() {
    int m, n;
    cin >> m >> n;
    vector< vector<int> > a(m, vector<int>(n));
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < n; j++) {
            cin >> a[i][j];
        }
    }
    int t = min(m, n);
    int step = 0;
    int i = 0, j = 0;
    while (step < t) {
        for (j = step; j < n - step; j++) {
            cout << a[i][j] << " ";
        }
        j--;
        for (i = step + 1; i < m - step; i++) {
            cout << a[i][j] << " ";
        }
        i--;
        for (j = n - step - 2; j >= step; j--) {
            cout << a[i][j] << " ";
        }
        j++;
        for (i = m - step - 2; i >= step + 1; i--) {
            cout << a[i][j] << " ";
        }
        i++;
        step++;
    }
    cout << endl;
    return 0;
}