Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. // end_up_11.cpp: определяет точку входа для консольного приложения.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. setlocale(LC_ALL, "rus");
  11. int a, b;
  12. float s = 0;
  13. cout << "Введите элемент ";
  14. cin >> a;
  15. cout << "Введите элемент ";
  16. cin >> b;
  17. while (a && b) {
  18. int c;
  19. cout << "Введите элемент ";
  20. cin >> c;
  21. if (b < 0 && a % 10 == 1 && (a / 10) % 10 == 1 && c % 10 == 1 && (c / 10) % 10 == 1) {
  22. s += b * b;
  23. }
  24. a = b;
  25. b = c;
  26. }
  27. cout << "сумма " << s << endl;
  28. system("pause");
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement