Advertisement
Josif_tepe

Untitled

Nov 22nd, 2023
939
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void funkcija(int x) {
  4.     while(x > 0) {
  5.         int posledna_cifra = x % 10;
  6.         int pretposledna_cifra = (x / 10) % 10;
  7.         int dvocifren_broj = pretposledna_cifra * 10 + posledna_cifra;
  8.         if(dvocifren_broj >= 26) {
  9.             printf("Z");
  10.         }
  11.         else {
  12.             printf("%c", 'A' + dvocifren_broj);
  13.         }
  14.         x /= 100;
  15.     }
  16.  
  17. }
  18. int main() {
  19.     int n;
  20.     scanf("%d", &n);
  21.    funkcija(n);
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement