Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- int n, n1, n2, n3, n4;
- scanf("%d", &n);
- n1 = n%10;
- n = n / 10;
- n2 = n % 10;
- n = n / 10;
- n3 = n % 10;
- n = n / 10;
- n4 = n % 10;
- if(n1 != 0){
- printf("%d%d%d%d\n", n1, n2, n3, n4);
- } else {
- if(n2 != 0){
- printf("%d%d%d\n", n2, n3, n4);
- } else {
- if(n3 != 0){
- printf("%d%d\n", n3, n4);
- } else {
- if(n4 != 0){
- printf("%d", n4);
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement