cardrank.c

来自「The art and science of c_source code!」· C语言 代码 · 共 26 行

C
26
字号
/* * File: cardrank.c * ---------------- * Reads in a number between 1 and 13 and writes out the * appropriate symbol for a playing card of that rank. */#include <stdio.h>#include "genlib.h"#include "simpio.h"main(){    int n;    printf("What is the rank of the card (1-13)? ");    n = GetInteger();    switch (n) {      case  1: printf("Ace\n"); break;      case 11: printf("Jack\n"); break;      case 12: printf("Queen\n"); break;      case 13: printf("King\n"); break;      default: printf("%d\n", n); break;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?