Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // end_up_11.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "rus");
- int a, b;
- float s = 0;
- cout << "Введите элемент ";
- cin >> a;
- cout << "Введите элемент ";
- cin >> b;
- while (a && b) {
- int c;
- cout << "Введите элемент ";
- cin >> c;
- if (b < 0 && a % 10 == 1 && (a / 10) % 10 == 1 && c % 10 == 1 && (c / 10) % 10 == 1) {
- s += b * b;
- }
- a = b;
- b = c;
- }
- cout << "сумма " << s << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement