5*5数字拼图

Home Home
引用 | 编辑 ice-m6
2007-04-23 18:08
楼主
推文 x0
期末的作业哪上来和大家分享吧
写的不是很好大家多多见谅
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
#define N 3
void make_array(void);
void put_array(void);
int a;

void main(void)
{
     int i,j,c,f,temp;
     char xy;
     make_array();                                          //做出乱数阵列
     printf("请用w、s、a、d来代表上下左右来移动\n");
     do{
           for(i=0;i<N;i++)
           {
                 for(j=0;j<N;j++)
                 {
                       if(a==9)         //找出空格的所在
                       {
                             xy=getch();      
                             if(xy==97)                        //如果按4的话跟右边的交换
                             {                  
                                   f=j+1;                        
                                   if(f>2)                        //如果是最旁边了会跳出
                                   {
                                         printf("他已是最边边了请换个方向吧\n");
                                         put_array();
                                         break;
                                   }
                                   else                        //如果不是最边边两边互换
                                   {
                                         temp=a;
                                         a=a;
                                         a=temp;
                                         put_array();      //再列出阵列
                                         break;
                                   }
                             }
                             else if(xy==100)                  //如果按6的话跟左边的交换
                             {
                                   f=j-1;
                                   if(f<0)
                                   {
                                         printf("他已是最边边了请换个方向吧\n");
                                         put_array();
                                         break;
                          ..

访客只能看到部份内容,免费 加入会员



献花 x0
引用 | 编辑 testbird2
2008-03-31 00:12
1楼
  
有没有程式呀,可否直接提供呢?

感谢啦~~~~~~ 表情

献花 x0
引用 | 编辑 kdliang03122
2008-04-26 14:41
2楼
  
stdafx.h ?
什么文件? 表情

献花 x0
引用 | 编辑 ATLer
2008-04-30 08:25
3楼
  
stdafx.h是vc生成的头文件

献花 x0
引用 | 编辑 a09000320
2008-08-31 14:15
4楼
  
好像不错的一个程式
这可以直接玩吗?

献花 x0
引用 | 编辑 kevin11671
2008-10-25 17:59
5楼
  
表情 编译有报错!?
表情 表情 表情
我用的是DEV-C++
我有试过把VC的头文件删掉
还有把void main 改成 int main
但是我还没看下面的错误
是DEV-C++ 的问题吗??
解答一下??

献花 x0
引用 | 编辑 overing
2008-10-25 21:36
6楼
  
引用vc的标头档就表示整份程式中有使用到该标头档中定义的项目
你只是把标头档拿掉当然解决不了问题
应该上网找找有没有那份标头档能下载
或是找找dev cpp有没有可以替代的标头档来用

献花 x0
引用 | 编辑 ericbin
2009-01-15 07:43
7楼
  
很不错的小程式!
下载来试看看啰!

献花 x0
引用 | 编辑 kem
2009-01-26 02:41
8楼
  
程序精良,十分有趣,值得鼓励。(已汇款1000雅币,请查收。)

献花 x0
引用 | 编辑 39721115
2009-12-12 17:46
9楼
  
请问可以提供可编译的原始程式吗?
本人是想用于专题请大大提供编译原始程式?
我有C++Builder 6 和 Dev-C++两款软体

献花 x0
引用 | 编辑 steven780413
2010-01-03 01:52
10楼
  
刚好我们的期末作业也要写一个程式
拿来参考看看 感谢 表情

献花 x0
引用 | 编辑 OK-MAN
2010-01-04 15:28
11楼
  
参考参考...学习中 表情

献花 x0
引用 | 编辑 Inndy
2010-02-04 20:39
12楼
  
晕..
我用DevC++5(4.9.9.X)
没有先看下去~哈
做的很好!
加油!! 表情

献花 x0
引用 | 编辑 k7138
2011-03-25 06:45
13楼
  
复制贴上就可以了吗

献花 x0
引用 | 编辑 csr
2011-03-25 21:49
14楼
  
我用dev c++ 4992无法编译成功
谢谢
stdafx.h如下
它是用在32位元的标头档
dev c++无法编译
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
//     are changed infrequently
//

#if !defined(AFX_STDAFX_H__95A22328_E88B_4D3B_A685_BEA5355785AE__INCLUDED_)
#define AFX_STDAFX_H__95A22328_E88B_4D3B_A685_BEA5355785AE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN            // Exclude rarely-used stuff from Windows headers

#include <afxwin.h>       // MFC core and standard components
#include <afxext.h>       // MFC extensions
#include <afxdisp.h>     // MFC Automation classes
#include <afxdtctl.h>            // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>                  // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT


//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__95A22328_E88B_4D3B_A685_BEA5355785AE__INCLUDED_)

献花 x0