Advertisement
Cesar_Biker

Untitled

Apr 13th, 2011
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.38 KB | None | 0 0
  1. //      eje_mult_3.c
  2. //      
  3. //      Copyright 2011 Angel <angel aka Cesar_Biker>
  4. //      
  5. //      This program is free software; you can redistribute it and/or modify
  6. //      it under the terms of the GNU General Public License as published by
  7. //      the Free Software Foundation; either version 2 of the License, or
  8. //      (at your option) any later version.
  9. //      
  10. //      This program is distributed in the hope that it will be useful,
  11. //      but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. //      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. //      GNU General Public License for more details.
  14. //      
  15. //      You should have received a copy of the GNU General Public License
  16. //      along with this program; if not, write to the Free Software
  17. //      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  18. //      MA 02110-1301, USA.
  19.  
  20.  
  21. #include <stdio.h>
  22. #include <stdlib.h>
  23.  
  24. int main(int argc, char **argv)
  25. {
  26.     int numero;
  27.     int l_numeros[81];
  28.     int numeros;
  29.     int i = 0;
  30.     int j;
  31.    
  32.     while((numero = getchar()) != '\n')
  33.     {
  34.         numeros = 0;
  35.         i = 0;
  36.         j = 0;
  37.         for(; numero != '\n';i++)
  38.         {
  39.             l_numeros[i] = (numero - 48);
  40.             numero = getchar();
  41.         }
  42.  
  43.         for(j = 0;j < i;j++)
  44.             numeros += l_numeros[j];
  45.    
  46.         if((numeros % 3) == 0)
  47.             printf("Ok\n");
  48.         else
  49.             printf("No\n");
  50.         //printf("%d",numeros);
  51.     }
  52.     return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement