c++编程,求程序设计,设计过程思路

建立一个类NUM,随机生成25个字符序列,并为特定序列进行排序。
具体要求如下:

img

代码及运行结果如下:

img

代码:

#include <iostream>
#include <time.h>
using namespace std;
class NUM
{
private:
    int data[25];
public:
    NUM(int data) //这里这个data有什么用
    {
        
        int i;
        srand((unsigned int)time(NULL)); 
        for(i=0;i<25;i++)
            this->data[i] = 33+ rand()%data; //ASCII码表中,可见字符从33-126  ,这里取余数只取到data
    }
    void process()
    {
        int i,j;
        int ch;
        for (i=0;i<24;i++)
        {
            for (j=0;j<24-i;j++)
            {
                if(data[j] > data[j+1])
                {
                    ch = data[j];
                    data[j]=data[j+1];
                    data[j+1]= ch;
                }
            }
        }
    }
    void print()
    {
        int i,j;
        for (i=1;i<=25;i++)
        {
            cout << (char) data[i-1];
            if(i%5 != 0)
                cout << " ";
            else
                cout << endl;
        }
    }
};

int main()
{
    NUM nn(40);
    nn.process();
    nn.print();
    return 0;
}

你的字符有啥要求啊?可见字符?还是必须'a'-'z','A'-'Z'?

data不是int类型吗