#include <stdio.h>
#include <string.h>
//#include <iostream>
#include <math.h>
#include <stdlib.h>
//using namespace std;

int main()
{
    double a = (-4.0+sqrt(7.0))/3.0;
    double b = (-4.0-sqrt(7.0))/3.0;
    printf("%f\n%f\n", a, b);
    return 0;
}

  以上代码,运行正常:

一个奇怪的语法问题

  尝试把注释去掉,输出就有问题了(控制台什么都不输出,电脑管家偶尔还会报病毒)。

一个奇怪的语法问题

  注意到return异常,一般应该return 0的,应该是std命名空间污染了标准输入输出printf。

  软件环境Codeblocks12.11,win8.1。后在win7系统下测试,却没有出现这个问题。

相关文章:

  • 2022-12-23
  • 2021-12-05
  • 2021-06-11
  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2021-07-03
猜你喜欢
  • 2021-06-04
  • 2022-12-23
  • 2021-06-24
  • 2021-07-26
  • 2021-12-08
相关资源
相似解决方案