YLXASRX 发表于 2019-7-22 23:21:19

我按小甲鱼老师给的代码抄了一遍,为什么无法运行出他那样的结果呢?

发不出照片【哭】


#include <stdio.h>
#include <math.h>

int main()
{
        double x,s;
        printf("input number:\n");
        scanf("%1f,$x");
        s=sin(x);
        printf("sin of %1f is %1f\n,x,x");
}


编译单个文件...
--------
- 文件名: C:\Documents and Settings\Administrator\My Documents\first one.cpp
- 编译器名: TDM-GCC 4.9.2 32-bit Release

处理 C++ 源文件...
--------
- C++ 编译器: %BinDir0%\g++.exe
- 命令: g++.exe "C:\Documents and Settings\Administrator\My Documents\first one.cpp" -o "C:\Documents and Settings\Administrator\My Documents\first one.exe" -m32 -I"%CppIncludeDir0%" -I"%CppIncludeDir1%" -I"%CppIncludeDir2%" -I"%CppIncludeDir2%\c++" -L"%LibDir0%" -static-libgcc -m32

编译结果...
--------
- 错误: 0
- 警告: 0
- 输出文件名: C:\Documents and Settings\Administrator\My Documents\first one.exe
- 输出大小: 104.9091796875 KiB
- 编译时间: 1.05s


运行后显示了个
inputnumber:
按小甲鱼说的输入30

“0x77clclad”指令引用的“0x77be2088”内存。该内存不能为“written”。
要终止程序,请单击“确定”。
要调试程序,请单击“取消”。
我点了取消出现一个
unhandled exception in first one.exe(MSVCRT.DLL):0xc0000005:Access Violation
我确定以后就出现一个
篮框,黄箭头以及很多77C1C1AD   mov这类的东西

ba21 发表于 2019-7-22 23:35:36

这抄的很有意思。我再改回来,你看能不能抄对。
#include <stdio.h>
#include <math.h>

int main()
{
      double x,s;
      printf("input number:\n");
      scanf("%lf", &x);
      s=sin(x);
      printf("sin of %lf is %lf\n", x, x);
}

YLXASRX 发表于 2019-7-23 08:44:26

ba21 发表于 2019-7-22 23:35
这抄的很有意思。我再改回来,你看能不能抄对。

感谢前辈!是我粗心
页: [1]
查看完整版本: 我按小甲鱼老师给的代码抄了一遍,为什么无法运行出他那样的结果呢?