Advertisement
EnsarMeskovic

Ispis brojeva sa osobinom : ABC = (AB^2) - (C^2)

Dec 27th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void ispis();
  5.  
  6. void main() {
  7.  
  8.     cout << "Trocifreni brojevi koji imaju svojstvo ABC = (AB^2)-(C^2) : " << endl;
  9.     ispis();
  10.     system("pause>0");
  11. }
  12. void ispis() {
  13.     for (int i = 100; i <= 999; i++) {
  14.         if (i == (pow(i / 10, 2) - pow(i % 10, 2)))
  15.             cout << i << endl;
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement