Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- bool current_variables_is_arithmetic_progression(const int& a, const int& b, const int& c) {
- if (pow(c, 2) - pow(b, 2) == pow(b, 2) - pow(a, 2)) {
- return true;
- }
- return false;
- }
- void task() {
- int a = 32, b, c;
- while (true) {
- for (int b = a + 1; b < 100; b++) {
- for (int i = 100; i > b; i--) {
- c = i;
- if (current_variables_is_arithmetic_progression(a, b, c)) {
- cout << pow(b, 2);
- }
- }
- }
- a++;
- }
- }
- int main() {
- task();
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement