Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int output(void);
- void rotate(int *pa, int *pb, int *pc);
- int main(void)
- {
- output();
- return 0;
- }
- int output(void)
- {
- int n1 = 1, n2 = 2, n3 = 3;
- char rw_input;
- while(1)
- {
- printf("%d:%d:%d",n1,n2,n3);
- rotate(&n1,&n2,&n3);
- scanf("%c",&rw_input);
- if(rw_input != 10) break;
- }
- }
- void rotate(int *pa, int *pb, int *pc)
- {
- int num_temp;
- num_temp = *pa;
- *pa = *pb;
- *pb = *pc;
- *pc = num_temp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement