Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1.cpp
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- vector<int> a(n);
- for (int i = 0; i < n; i++) {
- a[i] = rand() % 141 + 10;
- }
- int sum = 0;
- for (int i = 0; i < n; i++) {
- sum += a[i];
- }
- if (sum < 20) {
- cout << "Недогруз: ";
- } else if (sum > 750) {
- cout << "Перегруз: ";
- } else {
- cout << "ОК: ";
- }
- for (int i = 0; i < n; i++) {
- cout << a[i] << " ";
- }
- return 0;
- }
- // 2.cpp
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int sum = 0;
- for (int i = 0; i < n; i++) {
- int x;
- cin >> x;
- if (x > 99 || x < 10) {
- continue;
- }
- sum += x / 10;
- }
- cout << sum << '\n';
- return 0;
- }
- // 3.cpp
- // ошибка в примерах из условия?
- #include <iostream>
- using namespace std;
- int main() {
- int a, b;
- cin >> a >> b;
- cout << a + b * 50 << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement