全部评论 5

  • @𝓐𝓘𝓮𝓻
    退站了没有
    没退的话麻烦把那个团退了

    1周前 来自 浙江

    0
  • #include <iostream>
    using namespace std;
    char ch[110][1010];
    int main(){
    int n,m;
    cin>>n>>m;
    for(int i=0;i<=n-1;i++){
    for(int j=0;j<=m-1;j++){
    cin>>ch[i][j];
    }
    }
    for(int i=0;i<=n-1;i++){
    for(int j=0;j<=m-1;j++){
    if(ch[i][j]'T'){
    cout<<"("<<i<<","<<j<<")"<<" ";
    }
    }
    }
    cout<<endl;
    for(int i=0;i<=n-1;i++){
    for(int j=0;j<=m-1;j++){
    if(ch[i][j]
    'S'){
    cout<<"("<<i<<","<<j<<")"<<" ";
    }
    }
    }
    return 0;
    }

    1周前 来自 浙江

    0
  • 过了

    1周前 来自 浙江

    0
  • #include <iostream>
    #include <vector>
    #include <string>
    using namespace std;

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

    vector<string> grid(n);
    vector<pair<int, int>> treasures;  // 存储宝藏坐标
    vector<pair<int, int>> traps;      // 存储陷阱坐标
    
    // 读取地图
    for (int i = 0; i < n; i++) {
        cin >> grid[i];
    }
    
    // 遍历所有位置
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (grid[i][j] == 'T') {
                treasures.push_back({i, j});  // 宝藏
            } else if (grid[i][j] == 'S') {
                traps.push_back({i, j});      // 陷阱
            }
        }
    }
    
    // 输出宝藏坐标
    for (int i = 0; i < treasures.size(); i++) {
        cout << "(" << treasures[i].first << "," << treasures[i].second << ")";
        if (i != treasures.size() - 1) {
            cout << " ";
        }
    }
    cout << endl;
    
    // 输出陷阱坐标
    for (int i = 0; i < traps.size(); i++) {
        cout << "(" << traps[i].first << "," << traps[i].second << ")";
        if (i != traps.size() - 1) {
            cout << " ";
        }
    }
    cout << endl;
    
    return 0;
    

    }

    1周前 来自 浙江

    0
  • 还要进团?

    1周前 来自 浙江

    0

热门讨论