#include<iostream>
#include<stdio.h>
#include<windows.h>
#include<string.h>
#include<fstream>
using namespace std;
int main()
{
std::ofstream ofs;
std::ifstream ifs;
ofs.open("E://04.txt",std::ios::out|std::ios::trunc);
ofs<<1<<2<<3<<5;
ofs.close();
ifs.open("E://04.txt");
char ch[256]={0};
ifs>>ch;
printf("%s\n",ch);
int k=0;
int length=0;
while(ch[k]>'0'&&ch[k]<'20')
{
length++;
k++;
}
cout<<"长度"<<length<<endl;
int a[3]={};
for(int p=0;p<length;p++)
{
a[p]=ch[p]-48;
}
ifs.close();
int h1=0,h2=0;
for(int m=0;m<=length-2;m++)
{
h1=0;h2=0;
for(int s=0;s<=m;s++){
h1+=(a[s]);
}
for(int d=m+1;d<=length-1;d++){
h2+=(a[d]);
}
if(h1==h2)
{
cout<<"成功"<<endl;
ofs.open("E://output.txt",std::ios::out|std::ios::trunc);
ofs<<"YES";
ofs.close();
Sleep(80000);
return 0;
}
}
cout<<"失败"<<endl;
ofs.open("E://output.txt",std::ios::out|std::ios::trunc);
ofs<<"NO";
ofs.close();
Sleep(80000);
return 0;
}