Last active
August 29, 2015 14:11
-
-
Save Code-Hex/5293657e3b3c07460ec7 to your computer and use it in GitHub Desktop.
6-5 閏年(超楽しい!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
みんながみんな一緒だったら面白くないっしょ(笑)
それはある!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
三項演算子のネストの嵐で目が妊娠しそう