#include #include #include #include using namespace std; int main(int argc, char *argv[]) { int position(0), position2(0), length(0), i(0); double number(0), sum(0); string str1, str2; stringstream stream; cout << "please enter a number"; getline(cin, str1, '='); str1.insert(0, 1, '0'); str1.insert(1, 1, '\n'); int b(str1.length()); //cout << str1; cout << b; system("PAUSE"); while ( i <= b-3 ) { position = str1.find('\n', i); cout << "\nposition" << position; position2 = str1.find('\n', position+1); cout << "\nposition2" << position2; length = (position2 - position -1); cout << "\nlength"; cout << length; system("PAUSE"); str2.clear(); str2 = str1.substr(position+1, length); cout << "\nstr2" << str2; stream.clear(); stream << str2; stream >> number; sum += number; cout << "\nnumber="<