资源简介
C语言的科学与艺术课后习题的实训答案,

代码片段和文件信息
/*
*Coures: C Language Training
*Text:11 _12
* Name: xiang yang
*School No: 2018051604081
*/
/*
* File: checkerboard.c
* --------------------
* This program will InitCheckerboard and DisplayCheckerboard
*/
#include
#include “genlib.h“
#include “simpio.h“
/* Contants */
#define row 8
#define column 8
/* Function prtotypes */
static void DisplayCheckerboard(void);
static void InitCheckerboard(void);
static char PrintChar(int i int j);
/* Array */
static char BoardArray[row][column];
/* Main Program */
int main()
{
printf(“This program InitCherkerboard and DisplayCheckerboard\n“);
InitCheckerboard();
DisplayCheckerboard();
return 0;
}
/*
* Function: InitCheckerboard
* Usage: InitCheckerboard()
* -------------------------
* This function initializes board.
*/
static void InitCheckerboard(void)
{
int i j;
for (i = 0; i < row; i ++) {
for (j = 0; j < column; j ++) {
BoardArray[i][j] = PrintChar(i j);
}
}
}
/*
* Function: DisplayCheckerboard
* Usage: DisplayCheckerboard()
* ----------------------------
* Display checkerboard and display the current status of the Board on the screen
*/
static void DisplayCheckerboard(void)
{
int i j;
for (i = 0; i < row; i ++) {
for (j = 0; j < column; j ++) {
printf(“%c“ BoardArray[i][j]);
}
printf(“\n“);
}
}
/*
* Function: PrintChar
* Usage: PrintChar(i j)
* ------------------
* This function enter char to BoardArray[][]
*/
static char PrintChar(int i int j)
{
if ((i % 2) == 0) {
if (j % 2 == 0) return (‘ ‘);
switch (i) {
case 0: case 2: return (‘b‘);
case 4: return (‘-‘);
case 6: return (‘r‘);
}
} else {
if (j % 2 != 0) return (‘ ‘);
switch (i) {
case 1: return (‘b‘);
case 3: return (‘-‘);
case 5: case 7: return (‘r‘);
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-01-05 07:53 2018051604081_xiangyang\
目录 0 2019-01-05 07:50 2018051604081_xiangyang\11_12\
文件 8496 2019-01-05 07:13 2018051604081_xiangyang\11_12\zz78_1
文件 1877 2019-01-05 07:16 2018051604081_xiangyang\11_12\11_12.c
目录 0 2019-01-05 07:51 2018051604081_xiangyang\14_12\
文件 3530 2019-01-05 04:21 2018051604081_xiangyang\14_12\14_12.c
文件 37776 2019-01-05 04:08 2018051604081_xiangyang\14_12\zz78
文件 67471 2019-01-05 04:04 2018051604081_xiangyang\2_1.PNG
文件 17911 2018-12-28 11:15 2018051604081_xiangyang\1.PNG
文件 47065 2019-01-05 03:54 2018051604081_xiangyang\2_2.PNG
文件 45000 2019-01-05 07:48 2018051604081_xiangyang\0.PNG
- 上一篇:远程桌面源码
- 下一篇:大数计算器的c语言实现
相关资源
- Bmp图像处理.zip
- C++ Concurrency in Action 2nd Edition (2019.
- C++ Concurrency in Action中文PDF
- 流程图生成器C语言
- C++ Concurrency in Action- 2nd Edition(英文第
- 简单画图软件c++
- C++ Concurrency in Action (2nd) 无水印
- C++ Concurrency in Action 2nd edition235206
- 基于CY7C68013A的USB2.0详细开发文档
- c++ concurrency in action 2nd edition
- C语言-ATM机模拟系统exe及源码
- Saliency Map opencv C++
- c++ 并发编程实战 中文版+英文版
- 数据结构C语言代码实现
- CY7C68013A新官方资料
- cygnus c++ 2.91.57 for windows
- hotelcy大学餐厅的管理系统源码(附数
- 《C Concurrency in Action》中文版V1.0
- 隋连升主讲+谭浩强《c语言程序设计》
- Cygnus C++ 2.91.57中所有的头文件侯捷,
- C语言-打字母小游戏
- 使用C++实现的CYK算法
- 基于单片机的银行排队叫号系统的设
- c语言程序设计题总结资源
- CYK算法的C++实现
- 用c++ 定义一个车(Vehicle)基类,有
- 操作系统抢占式短进程优先调度算法
- C语言链表完整代码
- Concurrency with Modern C++(2019).pdf
- Dependency Walker中文汉化版
评论
共有 条评论