Skip to content

Instantly share code, notes, and snippets.

@fferegrino
Created March 11, 2014 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fferegrino/9497742 to your computer and use it in GitHub Desktop.
Save fferegrino/9497742 to your computer and use it in GitHub Desktop.
Div 4
#include <stdio.h>
#include <string.h>
int main(){
char num[100];
int n,c,T;
scanf("%d",&T);
while(T--)
{
scanf("%s",num);
n = strlen(num)-1;
c = num[n];
if(n) c += num[n-1] * 10;
c % 4 == 0 ? printf("YES\n") : printf("NO\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment