可能...emm...
好像有点不支持...
不过马上会改好的..
by smallfang @ 2018-11-05 19:39:11
@[smallfang](/space/show?uid=99640)
加油,滋磁滋磁
by Victorique_De_Blois @ 2018-11-05 19:39:27
@[Jack_killer](/space/show?uid=110593)
试一下这个:
```
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
bool sou(string x,char a)
{
for(int i=0;i<x.size();i++)
{
if(x[i]==a)return true;
}
return false;
}
int main()
{
cout<<"欢迎使用代码整齐调整clco v0.1\n";
int s=0;
cout<<"请输入输出文件:";
string outfile;
getline(cin,outfile);
ofstream fout;
fout.open(outfile.c_str());
string i;
cout<<"请输入代码内容(stop结束):\n";
while(getline(cin,i))
{
if(i=="stop")return 0;
if(sou(i,'}'))
{
s--;
}
for(int j=1;j<=s;j++)fout<<" ";
if(sou(i,'{'))
{
s++;
}
for(int j=0;j<i.size();++j)
{
fout<<i[j];
if(i[j]==';')
{
fout<<endl;
for(int k=1;k<=s;k++)fout<<" ";
}
}
fout<<endl;
}
system("pause>nul");
return 0;
}
```
by smallfang @ 2018-11-05 19:45:35
可能会解决问题
by smallfang @ 2018-11-05 19:45:56
今天先更到这里
by smallfang @ 2018-11-05 19:57:47
以后的多半会在b.sf007.cf上发...
by smallfang @ 2018-11-06 09:43:16
# V0.2
好似只更新了代码可以在一行,最后会形成好多行
代码:
```
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
bool sou(string x,char a)
{
for(int i=0;i<x.size();i++)
{
if(x[i]==a)return true;
}
return false;
}
int main()
{
cout<<"欢迎使用代码整齐调整clco v0.1\n";
int s=0;
cout<<"请输入输出文件:";
string outfile;
getline(cin,outfile);
ofstream fout;
fout.open(outfile.c_str());
string i;
cout<<"请输入代码内容(stop结束):\n";
while(getline(cin,i))
{
if(i=="stop")return 0;
if(sou(i,'}'))
{
s--;
}
for(int j=1;j<=s;j++)fout<<" ";
if(sou(i,'{'))
{
s++;
}
for(int j=0;j<i.size();++j)
{
fout<<i[j];
if(i[j]==';')
{
fout<<endl;
for(int k=1;k<=s;k++)fout<<" ";
}
}
fout<<endl;
}
system("pause>nul");
return 0;
}
```
by smallfang @ 2018-11-08 20:15:15
@[Jack_killer](/space/show?uid=110593)
by smallfang @ 2018-11-08 20:15:29
@[smallfang](/space/show?uid=99640) 在呢,帮你捞一下贴
by Victorique_De_Blois @ 2018-11-09 12:34:59
$\huge\text{后排兹磁!}$
by 狸狸养的敏敏 @ 2018-11-09 12:41:18