... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Tuesday, December 24, 2013

UVA-10929 :: You can say 11

#include <stdio.h>
#include <string.h>
int main ()
{
     int n ,i , a ,b ,x ,p ;
     char  s [1005] ;

    while (gets (s) )
     {
          x=0 ;
         a = strlen (s) ;

         if (s [0] == '0' && a == 1) break ;

         for (i=0 ; i< a ; i++)
          {
               b= x *10 + (s[i] - 48) ;
               x=  b %11 ;
          }

          if (x == 0 ) printf ("%s is a multiple of 11.\n",s) ;
               else  printf ("%s is not a multiple of 11.\n",s) ;
     }

return 0 ;
}