为什么运行不了?怎么输出图形?


#include<iostream>

using namespace std;

int main()
{
    int i,j;
    cout<<"    /\    "<<endl;
    cout<<"   /  \   "<<endl;
    cout<<"  /    \  "<<endl;
    cout<<" /      \ "<<endl;
    cout<<"/________\"<<endl;


    return 0;
}

最后一个\没有转义呢

#include

using namespace std;

int main()
{
int i,j;
cout<<" /\ "<<endl;
cout<<" / \ "<<endl;
cout<<" / \ "<<endl;
cout<<" / \ "<<endl;
cout<<"/________\\"<<endl;
return 0;

#include

using namespace std;

int main()
{
int i, j;
cout << " /\ " << endl;
cout << " / \ " << endl;
cout << " / \ " << endl;
cout << " / \ " << endl;
cout << "/________\" << endl;
system("pause");
return 0;
}

\ 反斜杠需要转义

有帮助请采纳,复制下面代码去看看

 
#include<iostream>

int main()
{

    cout<<"    /\\    "<<endl;
    cout<<"   /  \\   "<<endl;
    cout<<"  /    \\  "<<endl;
    cout<<" /      \\ "<<endl;
    cout<<"/________\"<<endl;
    return 0;
}