C语言猜字谜游戏
来源:互联网 发布:川普 希拉里 知乎 编辑:程序博客网 时间:2024/04/27 21:58
采用课本所提有序四元组来解决
在编辑代码过程中发现一个有趣的问题
void input_table(char table[4][4]){char tempchar[5]; for(int i=0;i<4;i++){ printf("please input the line of the table :\n"); scanf("%s",tempchar);strcpy(table[i],tempchar);}}//输入谜面
void output_table(char table[4][4]){ for(int i=0;i<4;i++) { for(int j=0;j<4;j++) { printf("%c ",table[i][j]); } printf("\n"); } //输出谜面}char Skewtrix(char table[4][4],char table1[4][4]){for(int i = 0;i < 4;i++) { int temp,temp1;temp=i-(4-num);temp1=(4-num)-i;if(temp<0){temp=0;}if(temp1<0){temp1=0;} for(int j = 0;j < 4;j++){table1[i][j] = table[temp1+j][j+temp]; } }return table1[4][4];}//斜置
void main()
{
char table1[4][4];
//inputdty(dictionary);
input_table(table);
printf("\n%c",table[2][4]);
table[2][4]=3;//令这个数字等于几,输出结果会在第四行多几个空格
Skewtrix(table,table1);
output_table(table);
output_table(table1);
system("pause");
}please input the line of the table :1234please input the line of the table :1234please input the line of the table :1234please input the line of the table :1234一开始的不在数组定义中的【2,4】49之后的不在数组定义中的【2,4】输出结果please input the line of the table :1234please input the line of the table :1234please input the line of the table :1234please input the line of the table :1234一开始的不在数组定义中的【2,4】49之后的不在数组定义中的【2,4】输出结果1 2 3 41 2 3 41 2 3 4 2 3 41 2 31 2 3 42 3 43 4 请按任意键继续. . .1 2 3 41 2 3 41 2 3 4 2 3 41 2 31 2 3 42 3 43 4请按任意键继续. . .这是等于0 的结果
please input the line of the table :
1234
please input the line of the table :
1234
please input the line of the table :
1234
please input the line of the table :
1234
一开始的不在数组定义中的【2,4】
49
之后的不在数组定义中的【2,4】
输出结果
1 2 3 4
1 2 3 4
1 2 3 4
2 3 4
1 2 3
1 2 3 4
2 3 4
3 4
请按任意键继续. . .这是等于1的结果
please input the line of the table :
1234
please input the line of the table :
1234
please input the line of the table :
1234
please input the line of the table :
1234
一开始的不在数组定义中的【2,4】
49
之后的不在数组定义中的【2,4】
输出结果
1 2 3 4
1 2 3 4
1 2 3 4
2 3 4
1 2 3
1 2 3 4
2 3 4
3 4
请按任意键继续. . .这个是等于9的结果
please input the line of the table :
1234
please input the line of the table :
1234
please input the line of the table :
1234
please input the line of the table :
1234
一开始的不在数组定义中的【2,4】
49
之后的不在数组定义中的【2,4】
1
输出结果
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3
1 2 3 4
2 3 4
3 4 1
请按任意键继续. . .这是不给赋值的结果
初步结论table【2】【4】会影响【.3】【3】
其int值为49,为1的ascll码表值,即(2,4)关联(3,3)
为什么只有他关联?
因为地址
太难
所以放弃了
- C语言猜字谜游戏
- 字谜游戏(a)C语言
- 字谜游戏(b)C语言
- 猜字谜游戏
- 猜字谜游戏
- Weiss-(DSAA - in C,1.3)字谜游戏
- MATLAB编写的猜字谜游戏
- 求解字谜游戏问题
- 猜字谜
- 《数据结构与算法分析-C语言描述》中的字谜问题
- JAVA编程思想导论(猜字谜游戏1.0)
- JAVA封装思想导论(猜字谜游戏2.0)
- 《数据结构算法分析C描述》引论:选择问题,字谜游戏问题
- 《数据结构算法分析C描述》引论:选择问题,字谜游戏问题
- c语言"猜动物"游戏
- C语言 猜数游戏
- C语言猜字游戏
- C语言 猜字游戏
- C# Show()跟ShowDialog()
- 熵
- 整理的比较好的图像去雾算法
- 启动虚拟机提示Intel VT-x处于禁用状态解决方案
- 实例2.2 一元多项式的乘法与加法运算
- C语言猜字谜游戏
- ExpandableRecycleview之简单实现
- React Native框架介绍
- iOS 程序启动 -> dyld 加载 -> runtime 初始化(初识)
- Android加密之全盘加密
- python 遇见的问题
- 第二篇:JAVA之基础语言概述
- ROS统计在线用户数脚本
- 使用Badboy做参数化 设置