Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int d = 3, v = 1,
- pilnas = 0,
- apkeistas = 0;
- while(d/v == 3 && d%v== 0)
- {
- pilnas = d*10+v; // kadangi 62 = 6*10 + 2
- apkeistas = v*10+d; // tas pats, tik apkeitus
- if(pilnas-apkeistas == 36)
- {
- cout << "Skaicius yra " << pilnas << endl;
- break;
- }
- else
- {
- cout << "Skaicius" << pilnas << "netinka" << endl;
- d += 3;
- v += 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement