josiftepe

Untitled

Dec 21st, 2020
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main(){
  4.     int n;
  5.     while(scanf("%d", &n) != 0) {
  6.         int broj = n; // zacuvaj ja vrednosta na n
  7.         while(broj > 0) { // dodeka brojot e pogolem od 0
  8.             int posledna_cifra = broj % 10; // zemi ja poslednata cifra na brojot
  9.             printf("%d ", posledna_cifra);
  10.             broj /= 10; // trgni ja poslednata cifra od samiot broj
  11.         }
  12.        
  13.     }
  14.     return 0;
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment