//Как- то так:) Проверял так: 5 1 1 5 7 9 => 7
#include "stdafx.h"
#include
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double s, k;
s = 0;
int n;
cout << "N = ";</span> cin >> n;
for (int i = 1; i <= n; i++)</span>
{
cin >> k;
if (k <= n)</span>
s += k;
}
cout << "> " << s << " <" << endl;</span>
system("pause");
return 0;
}