#include<stdio.h>
#include<math.h>
#include<time.h>
#include<conio.h>
#include<iostream.h>void main()
{
double a,b,sum;
time_t current_time;
struct tm *current_tm; time(&current_time);
current_tm=gmtime(&current_time);
cout<<"VC can use <iostream.h>";
cout<<"VC can use <time.h>";
printf("Greenwich Mean Time=%s\n",asctime(current_tm));
cout<<"VC can use <stdio.h>\n";
a=123.0;
b=456.0;
sum=fmod(b,a);   
printf("sum is %e\n",sum);
cout<<"please input a char to test <conio.h>\n";
getch();
cout<<"VC can use <conio.h>\n";
getch();
}
这个程序中,cout语句是做什么用的啊?最后运行没有看出这个语句的效果啊

解决方案 »

  1.   

    如果是控制台程序,加上system("pause")
      

  2.   

    getch();Gets a character from the console without echo. 
      

  3.   

    这个程序中,cout语句是做什么用的啊?最后运行没有看出这个语句的效果啊?
    ===========
    cout是输出字符串到屏幕.
    看不到效果是:你把#include<iostream.h>
    更改为:
    #include<iostream>
    using namespace std;在使用标准头文件的时候尽量使用新的标准头文件,新的一般没有.h结尾,有的还会在头上加上个C.
      

  4.   

    看看你用的是什么平台开发~   如果是VS的话,加上#include<iostream>  using namespace std;然后在程序结束处加上system("pause");return 0;printf是c中标准的输出;
      

  5.   

    直接在程序后面加吗?会报错啊error C2065: 'system' : undeclared identifier
      

  6.   

    cout与printf不是都是输出显示结果吗?为什么先显示的是printf输出格林威治时间的结果啊