目录
题目描述
https://vj.e949.cn/41e0e34d61d7191aed9fc036c8405496?v=1542228492
题意分析
题意: 将双引号替换
AC代码
#include <cstdio>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstdlib>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <string>
#include <cstring>
#include <memory.h>
#define MAXN 10005
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
int main()
{
char temp;
bool p=true;
while( (temp=getchar())!=EOF )
{
if(temp!='"')
{
cout<<temp;
}
else
{
printf("%s",p?"``":"''");
p=!p;
}
}
return 0;
}
本文介绍了一种使用C++实现的字符串处理技巧,具体为将字符串中的双引号()替换为ASCII艺术形式(``或''),以适应不同的显示环境。通过分析题意并提供完整的AC代码,展示了如何读取输入流并在输出时进行字符替换。
1750

被折叠的 条评论
为什么被折叠?



