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