# 人工智能编辑员

## 样例输入

I am a human existence but you are something more complicated


## 样例输出

36

(1+1+2)*100/11=36.36=36

#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
struct
{
int flag;
char s[100];
int sum;
int xx;
}node[1000];
int main()
{
string str;
getline(cin, str);
int num = str.size();
int count = 0;
int k = 0;
int x = 0;
int counter = 0;
for (int i = 0; i < num; i++)
{
if (str[i] == ' ')
{
if (x > 7)
{
counter++;
node[k].flag = 1;
node[k].sum = (x - 7) * 50;
node[k].xx = x;
}
else
node[k].flag = 0;
count++;
x = 0;
k++;
}
else
{
node[k].s[x] = str[i];
x++;
}
if (i == num - 1)
{
count++;
if (x > 7)
{
counter++;
node[k].flag = 1;
node[k].sum = (x - 7) * 50;
node[k].xx = x;
}
else
node[k].flag = 0;
}
}
long long Sum = 0;
for (int i = 0; i <= k; i++)
{
if (node[i].flag == 1)
Sum += node[i].sum;
}
cout << Sum / count << endl;
cout << endl;
cout << "解析：共" << count << "个单词，其中8个字母以上的有";
int C = 0;
for (int i = 0; i <= k; i++)
{
if (C == counter)
break;
if (node[i].flag == 1)
{
C++;
for (int j = 0; j < node[i].xx; j++)
cout << node[i].s[j];
cout << ",";
}
}
cout << endl;
cout << "价值分别为";
C = 0;
for (int i = 0; i <= k; i++)
{
if (node[i].flag == 1)
{
if (C == counter - 1)
{
cout << node[i].sum*1.0 / 100 << ";";
break;
}
C++;
cout << node[i].sum*1.0 / 100 << ",";
}
}
cout << endl;
cout << "(";
C = 0;
for (int i = 0; i <= k; i++)
{
if (node[i].flag == 1)
{
if (C == counter - 1)
{
cout << node[i].sum*1.0 / 100;
break;
}
C++;
cout << node[i].sum*1.0 / 100 << "+";
}
}
cout << ")*100/" << count << "=" << fixed << setprecision(2) << Sum*1.0 / count << "=" << Sum / count;
}
/**************************************************************
Problem: 1736
User: 201730685257
Language: C++
Result: 正确
Time:0 ms
Memory:1592 kb
****************************************************************/

• 广告
• 抄袭
• 版权
• 政治
• 色情
• 无意义
• 其他

120