hazi 1 meg felig ketto

This commit is contained in:
kaoplo 2022-10-23 14:37:04 +02:00
parent 21becc1044
commit bad3b165a5
3 changed files with 82 additions and 0 deletions

24
hf2/hf4/1.cpp Normal file
View file

@ -0,0 +1,24 @@
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
// https://host.pawz.hu/8840nfIq.png
int main() {
int n, out, temp, temp2, max;
max = 0;
cin >> n;
for (int i = 0; i < n; i++) {
temp2 = 0;
for (int j = 0; j < 7; j++) {
cin >> temp;
temp2 += temp;
}
if (temp2 > max) {
max = temp2;
out = i+1;
}
}
cout <<out;
}

39
hf2/hf4/3.cpp Normal file
View file

@ -0,0 +1,39 @@
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int n, m, temp;
//int min = 51;
//int max = -51;
int out = 1;
cin >> n >> m;
vector<vector <int>> maxmin(m, vector<int> (3)); // min, max /n
for (int i = 0; i < n; i++) {
int min = 51;
int max = -51;
for (int j = 0; j < m; j++) {
cin >> temp;
if (temp > max) {
max = temp;
}
if (temp < min) {
min = temp;
}
}
cout<<min<<' '<<max<<endl;
maxmin[i][0] = min;
maxmin[i][1] = max;
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cout<<maxmin[i][j]<<' ';
}
cout<<endl;
}
cout<<out;
}

19
ora/1016/1.cpp Normal file
View file

@ -0,0 +1,19 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
vector < int > megoldas;
int n, k, m, f;
cin >> n >> k;
for (int i = 0; i < n; i++) {
cin >> m >> f;
if (m < k) {
megoldas.push_back(i+1);
}
}
sort(megoldas.begin(), megoldas.end());
cout << megoldas.size() << ' ';
for (int i = 0; i < megoldas.size(); i++) {
cout << megoldas[i]<< " ";
}
}