我在使用C++打印字符串时遇到问题.
我知道在SO上有很多关于这个问题的话题,但是大多数人说要包括<string>,<iostream>或者namespace std.但我做了所有这些但仍然遇到了这个问题.这是我的代码和错误.
#include <iostream>
#include <string>
using namespace std;
//...
void affiche_date(int annee, int nbjours) {
string mois;
if (nbjours>31) {
mois = "avril";
nbjours -= 31;
} else {
mois = "avril";
}
cout << "Date de Paques en " << annee << " : " << nbjours << " " << mois << end;
}
int main() {
int annee ( demander_annee() ) ;
int jour ( date_paques(annee) );
affiche_date(annee, jour); …Run Code Online (Sandbox Code Playgroud)