Advertisement
Guest User

zigzag1

a guest
Nov 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. int main()
  4. {
  5. int a,b,c,d,e,f,x,i=1;
  6.  
  7.  
  8.  
  9. while (i>0){
  10.  
  11. scanf("%d",&x);
  12. a=x%10;
  13. b=x/10%10;
  14. c=x/100%10;
  15. d=x/1000%10;
  16. e=x/10000%10;
  17. f=x/100000%10;
  18. if (a>b && b<c && c>d && d<e && e>f){
  19. printf("%d",x);
  20. }
  21. else if (a<b && b>c && c<d && d>e && e<f){
  22. printf("%d",x);
  23. }else if (x='k'){
  24. i=0;
  25.  
  26. }
  27.  
  28. }
  29.  
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement