鄠邑区建设局网站,输入关键词就能写文章的软件,软文营销的特点有哪些,做网站加载速度有什么方法字符串展开
题目大意#xff1a;
一串缩写的字符串#xff0c;将它缩写前的输出来#xff08;详情见原题#xff09;
原题 解题思路#xff1a;
直接模拟每一个字符即可
代码#xff1a;
#includecstdio
#includestring
#includecstring
#…字符串展开
题目大意
一串缩写的字符串将它缩写前的输出来详情见原题
原题 解题思路
直接模拟每一个字符即可
代码
#includecstdio
#includestring
#includecstring
#includeiostream
using namespace std;
int p1,p2,p3,l;
string str;
int main()
{scanf(%d %d %d,p1,p2,p3);cinstr;lstr.size();str str;for (int i1;il;i){if (str[i]-)//判断是否为神略部分{if (str[i-1]0str[i-1]9str[i1]str[i-1]str[i1]9)//数字{if (p31)//无需倒叙for (int jstr[i-1]1;jstr[i1];j)//所有省略的字符for (int k1;kp2;k)//输出的个数if (p13) putchar(*);//判断是否要改为“*”else putchar(j);else//要倒序for (int jstr[i1]-1;jstr[i-1];--j)//反过来for (int k1;kp2;k)//同上if (p13) putchar(*);else putchar(j);continue;}if (str[i-1]astr[i-1]zstr[i1]str[i-1]str[i1]z){if (p31)for (int jstr[i-1]1;jstr[i1];j)for (int k1;kp2;k)if (p13) putchar(*);else if (p12) putchar(j-32);else putchar(j);elsefor (int jstr[i1]-1;jstr[i-1];--j)for (int k1;kp2;k)if (p13) putchar(*);else if (p12) putchar(j-32);//大写else putchar(j);continue;}}putchar(str[i]);//不是省略的就直接输出}
}