1. 程式人生 > 資訊 >Netflix 推新功能:WiFi 連線下將使用者喜歡內容下載到手機

Netflix 推新功能:WiFi 連線下將使用者喜歡內容下載到手機

隨機數 srand((unsigned int)time(NULL));
隨機數標頭檔案 #include < ctime>
#include"string" 字串頭

struct student
{
string sName;
int age;
int score;
};
struct teacher
{
string tName;
struct student sArray[5];
};
void allocateSpace(struct teacher tArray[], int len)
{
string nameSeed = “ABCDE”;
for (int i = 0; i < len; i++){

tArray[i].tName = “Teacher_”;
tArray[i].tName += nameSeed[i];

for (int j = 0; j < 5; j++)
{
tArray[i].sArray[j].sName = “student_”;
tArray[i].sArray[j].sName += nameSeed[j];

			int random = rand() % 61+40;
			tArray[i].sArray[j].score = random;

	}
}

};

string aba=“abcd”;
string a=“name_";
a+=aba[0];

在這裡插入圖片描述