Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main () {
- int a, b;
- scanf("%d%d", &a, &b);
- for(int i = a; i <= b; i++) {
- for(int j = i; j <= b; j++) {
- int zbir = i + j;
- int proizvod = i * j;
- int prevrten = 0;
- while(proizvod > 0) {
- int cifra = proizvod % 10;
- prevrten = (prevrten * 10) + (cifra);
- proizvod /= 10;
- }
- if(prevrten == zbir) {
- printf("%d %d\n", i, j);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement