Created
June 18, 2016 03:43
-
-
Save mktakuya/920d819f7f91fae064f8c9955edaa312 to your computer and use it in GitHub Desktop.
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(void) | |
{ | |
int age; | |
char gender; | |
printf("[女性と子供の安心車両 乗車判定プログラム]\n"); | |
printf("性別を入力してください(m: 男性, f: 女性)\n"); | |
printf("--> "); | |
scanf("%c", &gender); | |
printf("年齢を入力してください。\n"); | |
printf("--> "); | |
scanf("%d", &age); | |
if (gender == 'f') { | |
printf("乗車できます。\n"); | |
} else if (gender == 'm' && age <= 12) { | |
printf("乗車できます。\n"); | |
} else { | |
printf("乗車できません。\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment