当前位置: 代码迷 >> C语言 >> 【求助高手】一个看似简单其很挺难的程序
  详细解决方案

【求助高手】一个看似简单其很挺难的程序

热度:426   发布时间:2008-06-19 19:38:19.0
- -!吓得我!
要是她16 和我一样 我不疯狂看书 我跟她性
----------------解决方案--------------------------------------------------------
[bo][un]卧龙孔明[/un] 在 2008-6-19 19:26 的发言:[/bo]


#include
int main(void)
{
    int p=1;
    char t[81];
    freopen("bslz.in","r",stdin);
    freopen("bslz.out","w",stdout);
    while(gets(t)!=EOF)
    {
        if(t[0])
        {
      ...



------ Build started: Project: reshape, Configuration: Debug Win32 ------
Compiling...
reshape.cpp
.\reshape.cpp(6) : warning C4996: 'freopen' was declared deprecated
        D:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(245) : see declaration of 'freopen'
        Message: 'This function or variable may be unsafe. Consider using freopen_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
.\reshape.cpp(7) : warning C4996: 'freopen' was declared deprecated
        D:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(245) : see declaration of 'freopen'
        Message: 'This function or variable may be unsafe. Consider using freopen_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
.\reshape.cpp(8) : error C2446: '!=' : no conversion from 'int' to 'char *'
        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
.\reshape.cpp(8) : error C2040: '!=' : 'char *' differs in levels of indirection from 'int'
Build log was saved at "file://c:\Documents and Settings\Chen\My Documents\Visual Studio 2005\Projects\reshape\reshape\Debug\BuildLog.htm"
reshape - 2 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

这实在Vc++上运行你程序的结果
----------------解决方案--------------------------------------------------------
哈哈哈哈

你用gcc试试
----------------解决方案--------------------------------------------------------
还用我传个编译完的程序上来?
lz不会没有或根本不知道gcc吧...
----------------解决方案--------------------------------------------------------
[bo][un]卧龙孔明[/un] 在 2008-6-19 19:44 的发言:[/bo]

哈哈哈哈

你用gcc试试

你就别理他了,他连最起码的复制都出错,还学什么编程啊


[flash=400,300]http://yzfy.byethost17.com/flash.php[/flash][color=white]
----------------解决方案--------------------------------------------------------
这是我需要处理的文件,你自己跑跑看看
----------------解决方案--------------------------------------------------------
楼主用这个吧
程序代码:

#include<stdio.h>
int main(void)
{
    int p=1;
    char t[81];
    freopen("bslz.in","r",stdin);
    freopen("bslz.out","w",stdout);
    while(gets(t))
    {
        if(t[0])
        {
            if(p) { puts(t); p=0; }
        }
        else
        {   
            p=1;
        }
    }        
    return 0;
}   

----------------解决方案--------------------------------------------------------
LZ啊LZ,你就一个XXXX......
----------------解决方案--------------------------------------------------------
[bo][un]卖菜的鸟[/un] 在 2008-6-19 19:38 的发言:[/bo]

- -!吓得我!
要是她16 和我一样 我不疯狂看书 我跟她性

啊呀~~~~你要是想当MM我不反对啊


[flash=400,300]http://yzfy.byethost17.com/flash.php[/flash][color=white]
----------------解决方案--------------------------------------------------------
偶另一个flash小游戏快写好了。。。


[flash=400,300]http://yzfy.byethost17.com/flash.php[/flash][color=white]
----------------解决方案--------------------------------------------------------
  相关解决方案