【发布时间】:2019-02-15 12:34:07
【问题描述】:
// francais projecct test1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
char userAnswer[10];
char answer[] = { "Vous êtes" };
wcout << "s'il vous plaat ecrire conjugation pour Vous etre: ";
cin>>userAnswer;
if (strcmp(userAnswer, answer) == 0)
cout << endl << "correct"<<endl<<endl;
else
cout << endl << "wrong answer"<<endl<<endl;
system("pause");
return 0;
}
编译器无法识别重音字符,如果需要 unicode,我不知道如何获取 unicode 字符的输入。
【问题讨论】:
-
P.S. “plaît”有一个抑扬符,“écrire”有一个锐音。
-
虽然我通常会为您尝试在 Windows 上使用 Unicode IO 鼓掌,但如果您只对法语口音(和控制台输出)感兴趣,那么您不需要:您可以涵盖大多数欧洲的默认代码页。
-
我的法语真的很生疏,但我也突然想到:无论如何,你可能想要“écrivez”,而不是“écrire”,作为命令式的 vous 形式。
-
结果程序只回答“是”,即使答案错误并且重音字符在终端中无法识别