Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**********************************************************************************/
- /* Problem: d124 "3的倍数" from */
- /* Language: C (353 Bytes) */
- /* Result: AC(0ms, 268KB) judge by this@ZeroJudge */
- /* Author: kkmomo at 2013-05-08 22:59:36 */
- /**********************************************************************************/
- #include<stdio.h>
- #define BUFFSIZE 10000
- int main(void)
- {
- int index, check;
- char buff[BUFFSIZE+1];
- check = 0;
- while(scanf("%s", buff)!=EOF)
- {
- index = buff[0]=='-' ? 1 : 0;
- for ( check = 0; buff[index]!='\0'; index++)
- check += buff[index];
- if (check%3!=0)
- printf("no\n");
- else
- printf("yes\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment