Advertisement
brsjak

Interesen Broj - SP Lab 3

Oct 25th, 2016
1,015
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. #include <stdio.h>
  2. int main (){
  3.     int n, brcif=0, dn, dekadenbr=1, cifra, obratensum=0;
  4.     scanf("%d", &n);
  5.     if(n<=9){
  6.         printf("Nevaliden");
  7.     }
  8.     else{
  9.         dn=n;
  10.         for(;dn;){
  11.             dn/=10;
  12.             brcif++;
  13.             dekadenbr*=10;
  14.         }
  15.         printf("%d\n", brcif);
  16.         printf("%d\n", dekadenbr);
  17.         dn=n;
  18.         for(;dn;){
  19.             obratensum+=1000*cifra=dn%10;
  20.             dekadenbr/=10;
  21.             dekadenbr 100;
  22.         }
  23.         if(obratensum%brcif==0){
  24.             printf("Interesno");
  25.         }
  26.     }
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement