Skip to content

Instantly share code, notes, and snippets.

@xnuk
Created April 23, 2014 21:07
Show Gist options
  • Save xnuk/11232442 to your computer and use it in GitHub Desktop.
Save xnuk/11232442 to your computer and use it in GitHub Desktop.
int main(){
char sID[15], i=13, sum=0;
scanf_s("%s", sID,15);
for(; i>6; i--)sum+=sID[i]-48;
i--;
for(; i>=0; i--)sum+=sID[i]-48;
printf("sum = %d\n", sum);
printf("%2d%c%c년 %d월 %d일 출생, %s자", (sID[7]<51)?19:20, sID[0], sID[1], (sID[2]-48)*10+sID[3]-48, (sID[4]-48)*10+sID[5]-48, (sID[7]%2)?"남":"여");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment