读取以空格分割的字符串

    1. while (scanf("%s", vocabulary[i]) != EOF) {
    2. j = 0;
    3. while (vocabulary[i][j]) { // 大写转小写
    4. vocabulary[i][j] = up_to_low(vocabulary[i][j]);
    5. j++;
    6. }
    7. i++;
    8. } // 并且大写转成小写

    C++读取方法

    1. string s[200];
    2. int i = 0; int n = 0,count=0;
    3. cin >> n;
    4. while (cin >> s[count]) {
    5. count++;
    6. }