【问题标题】:reading fortran exponential notation in cpp在cpp中读取fortran指数符号
【发布时间】:2012-10-06 16:39:31
【问题描述】:

我有一个来自 fortran 程序的输出。它看起来像:

  -0.218992624383943335E+001   0.141709629412732530E+001   0.798866756359534413E+000
  -0.333162729303917438E+001   0.544763361230827758E+001   0.352566739381167604E+001
  -0.633341755881933866E+000  -0.254058697110871812E+001  -0.712520767968274127E+000

将这些数字读入 C 或 C++ 代码 (sscanf) 的最简单方法是什么?

【问题讨论】:

    标签: c++ c fortran scanf


    【解决方案1】:

    使用 C++ 流:

    ifstream file("name");
    
    double number;
    file >> number;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-23
      • 2022-08-21
      • 1970-01-01
      • 2013-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多