Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int cifre(int);
- int main()
- {
- int broj = 1;
- cifre(broj);
- system("PAUSE");
- return 0;
- }
- int cifre(int broj)
- {
- int pohrana, temp, kvadrat;
- while (broj < 150) // (62<150)
- {
- pohrana = broj % 10; // pohrana=62%10; pohrana=2
- if (pohrana == 2) // (pohrana==2) true, ulazimo u petlju
- {
- temp = broj / 10; // temp=63/10; temp=6
- kvadrat = temp*temp; // kvadrat=36*36, što nam nikako ne treba--> kvadrat=temp*temp; kvadrat=6*6=36
- cout << broj << " " << kvadrat << endl;
- }
- broj++; // broj raste na 63 ---> BELAJ
- }
- return kvadrat;
- }
Advertisement
Add Comment
Please, Sign In to add comment