Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- #include "testing.h"
- int main()
- {
- int N, a, b, c, d, e, f, g;
- scanf("%d", &N);
- a = N / 100000 % 10;
- b = N / 10000 % 10;
- c = N / 1000 % 10;
- d = N / 100 % 10;
- e = N / 10 % 10;
- f = N % 10;
- if (b < a && b < c)
- {
- g = a;
- a = b;
- b = g;
- }
- if (c < a && c < b)
- {
- g = a;
- a = c;
- c = g;
- }
- if (c < b)
- {
- g = b;
- b = c;
- c = g;
- }
- if (e < d && e < f)
- {
- g = d;
- d = e;
- e = g;
- }
- if (f < d && f < e)
- {
- g = d;
- d = f;
- f = g;
- }
- if (f < e)
- {
- g = e;
- e = f;
- f = g;
- }
- if (a == d && b == e && c == f)
- {
- printf("Number is lucky");
- }
- else
- {
- printf("Number is not lucky");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement