目标:
输出:
(1,using)
(1,namespace)
(2,std)
(5,;)
(1,int)
(2,main)
(5,()
(5,))
(5,{)
(1,int)
(2,year)
(5,;)
(2,cout)
(4,<<)
(5,")
(2,hello)
(5,")
(4,<<)
(2,endl)
(5,;)
(1,return)
(3,0)
(5,;)
(5,})
因为怕麻烦,所以使用原始字符串来做。
用法:R"xxxx(原始字符串)xxxx"
(注意:两边的xxxx必须一致,同时不可以是汉字)
代码(这样写很方便):
#include<iostream>
using namespace std;
int main()
{
cout<<R"((1,using)
(1,namespace)
(2,std)
(5,;)
(1,int)
(2,main)
(5,()
(5,))
(5,{)
(1,int)
(2,year)
(5,;)
(2,cout)
(4,<<)
(5,")
(2,hello)
(5,")
(4,<<)
(2,endl)
(5,;)
(1,return)
(3,0)
(5,;)
(5,}))";
}