mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-29 14:17:07 -06:00
.reference
git-svn-id: svn://ultimatepp.org/upp/trunk@11740 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
a6cc035957
commit
01c27ecb2f
3 changed files with 87 additions and 12 deletions
|
|
@ -2,20 +2,11 @@
|
|||
|
||||
using namespace Upp;
|
||||
|
||||
force_inline double Sum(const String& s)
|
||||
{
|
||||
CParser p(s);
|
||||
double sum = 0;
|
||||
while(!p.IsEof())
|
||||
sum += p.ReadDouble();
|
||||
return sum;
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
SeedRandom(0);
|
||||
Vector<String> data;
|
||||
for(int i = 0; i < 10000000; i++) {
|
||||
for(int i = 0; i < 1000; i++) {
|
||||
int n = Random(7);
|
||||
data.Add();
|
||||
for(int j = 0; j < n; j++)
|
||||
|
|
@ -27,8 +18,11 @@ CONSOLE_APP_MAIN
|
|||
co * [&] {
|
||||
double m = 0;
|
||||
int i;
|
||||
while((i = co.Next()) < data.GetCount())
|
||||
m += Sum(data[i]);
|
||||
while((i = co.Next()) < data.GetCount()) {
|
||||
CParser p(data[i]);
|
||||
while(!p.IsEof())
|
||||
m += p.ReadDouble();
|
||||
}
|
||||
CoWork::FinLock();
|
||||
sum += m;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue