Другие языки программирования и технологии

Помогите написать задачи Си++ !

1. Что такое "пониженный положительный элемент"? Считает до минимального положительного:

#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <cstdlib>
#include <ctime>

using namespace std;

bool lop(int x, int y) { return x > 0 && x < y; }

int main() {
srand(time(0));

int a[10];
cout << "array:";
for (int c = 0; c < 10; ++c) cout << ' ' << (a[c] = rand() % 101 - 50);

int *fp = find_if(a, a + 10, bind2nd(greater<int>(), 0));
int *mp = min_element(fp, a + 10, lop);
cout << "\nsum: " << accumulate(a, mp, 0) << endl;

return 0;
}

2.

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>

using namespace std;

int main() {
srand(time(0));

int a[5][6];
cout << "matrix:\n";
for (int r = 0; r < 5; ++r) {
for (int c = 0; c < 6; ++c) cout << setw(4) << (a[r][c] = rand() % 50 - 10);
cout << endl;
}

cout << "sums:\n";
for (int c = 0; c < 6; ++ c) {
bool hn = false;
for (int r = 0; r < 5; ++r) {
if (a[r][c] < 0) {
hn = true;
break;
}
}
if (hn) {
int sum = 0;
for (int r = 0; r < 5; ++r) sum += a[r][c];
cout << "column #" << c << ": " << sum << endl;
}
}
return 0;
}
*витaля* - *cыceнкo*
*витaля* - *cыceнкo*
66 441
Лучший ответ
Если не критично до понедельника, могу сделать)) ) тебе тупо код? или и саму прогу скомпилировать ?