Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<time.h>
- void main()
- {
- char i;
- int a,k=0,b,n=1,f,v,e=0,r,g,j;
- printf("a=");
- scanf("%d",&a);
- printf("Sistema schislenia=");
- scanf("%d",&b);
- r=a/b;
- g=a%b;
- v=a/b;
- f=a%b;
- j=f*10;
- e=e+j;
- while (v)
- {
- f=v%b;
- v=v/b;
- j=f;
- while (k<=n-1)
- {
- j=j*10;
- k=k+1;
- }
- e=e+j;
- k=0;
- n=n+1;
- }
- if (b>=11) r=r; else {
- r=0;
- printf("%d",e);
- }
- while (r)
- {
- printf("%d%d",r,g);
- g=r%b;
- r=r/b;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement