Skip to content

Instantly share code, notes, and snippets.

@Mistat
Created June 7, 2010 14:39
Show Gist options
  • Save Mistat/428736 to your computer and use it in GitHub Desktop.
Save Mistat/428736 to your computer and use it in GitHub Desktop.
#include <stdio.h>
// 素人感を+
void main()
{
int tokuten; // 得点を格納する変数宣言
printf("英語のテストの得点を入力してください\n得数="); // 入力促進の表示
scanf("%d", &tokuten); // キーボードから数字を読み込む
// 以下で判定プログラム
if (tokuten > 100) {
printf("100点以上が入力されました。\n", tokuten);
} else {
printf("成績を表示します tokuten=%d\n",tokuten);
if (tokuten > 80) {
printf("成績はAです。\n");
} else if (tokuten > 60) {
printf("成績はBです。\n");
} else {
printf("不合格です。\n");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment