读文章代码

#include <bits/stdc++.h>
using namespace std;
int main()
{
    ofstream file;
    file.open("yuyin.txt");
    string s;
    char bd='"';
    while(cin>>s)
    {
        if(s[0]==s[1]&&s[1]=='0') break;
        int len=s.size();
        for(int i=0;i<len;i++)
        {
            if(s[i]=='"')
                s[i]='.';
        }
        char bd='"';
        file<<"CreateObject(";
        file<<bd;
        file<<"SAPI.SpVoice";
        file<<bd;
        file<<").Speak";
        file<<bd;
        file<<s;
        file<<bd;
        file<<"\n";
    }

}

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注