Skip to content

Instantly share code, notes, and snippets.

@Code-Hex
Last active August 29, 2015 14:11
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 Code-Hex/5293657e3b3c07460ec7 to your computer and use it in GitHub Desktop.
Save Code-Hex/5293657e3b3c07460ec7 to your computer and use it in GitHub Desktop.
6-5 閏年(超楽しい!)
#include <stdio.h>
int main(){
int year;
printf("この年は閏年--ver -0.1\n");
printf("気になる西暦を入力してね♡\n");
scanf("%d", &year);
int result = !(year % 4)? !(year % 100)? !(year % 400)? 1 : 0 : 1 : 0;
result? printf("%dは閏年!\n",year) : printf("%dは閏年じゃないよ\n",year);
return 0;
}
@walkingmask
Copy link

三項演算子のネストの嵐で目が妊娠しそう

@Code-Hex
Copy link
Author

みんながみんな一緒だったら面白くないっしょ(笑)

@walkingmask
Copy link

それはある!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment