关于CHATGPT
  • 板块灌水区
  • 楼主AXIS_PLAYER
  • 当前回复5
  • 已保存回复5
  • 发布时间2023/2/26 11:19
  • 上次更新2023/10/23 23:43:29
查看原帖
关于CHATGPT
796825
AXIS_PLAYER楼主2023/2/26 11:19
AI正在回答,请等待......
#include <iostream>
#include <fstream>
using namespace std;

int main(){
    ifstream fin("input.txt");
    int cnt[26] = {0};
    char c;
    while(fin >> c){
        cnt[c-'A']++;
    }
    int max = 0;
    for(int i=0; i<26; i++){
        if(cnt[i] > max){
            max = cnt[i];
        }
    }
    for(int i=max; i>=1; i--){
        for(int j=0; j<26; j++){
            if(cnt[j] >= i){
                cout << "* ";
            }else{
                cout << "  ";
            }
        }
        cout << endl;
    }
    for(int i=0; i<26; i++){
        cout << (char)(i+'A') << " ";
    }
    cout << endl;
    return 0;
}

谁帮我看看,CHATgpt 打的什么......

2023/2/26 11:19
加载中...