Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // eje_mult_3.c
- //
- // Copyright 2011 Angel <angel aka Cesar_Biker>
- //
- // This program is free software; you can redistribute it and/or modify
- // it under the terms of the GNU General Public License as published by
- // the Free Software Foundation; either version 2 of the License, or
- // (at your option) any later version.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with this program; if not, write to the Free Software
- // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- // MA 02110-1301, USA.
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char **argv)
- {
- int numero;
- int l_numeros[81];
- int numeros;
- int i = 0;
- int j;
- while((numero = getchar()) != '\n')
- {
- numeros = 0;
- i = 0;
- j = 0;
- for(; numero != '\n';i++)
- {
- l_numeros[i] = (numero - 48);
- numero = getchar();
- }
- for(j = 0;j < i;j++)
- numeros += l_numeros[j];
- if((numeros % 3) == 0)
- printf("Ok\n");
- else
- printf("No\n");
- //printf("%d",numeros);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement