qq_30081059 2015-12-25 06:56 采纳率: 0%
浏览 1369

使用iostream和iostream.h中遇到的编程问题

运行下面两个程序为什么它的运行结果会不同,求大神解决
#include
#include
#include
#include
void gotoxy(int x, int y)//定位光标
{
COORD pos;
pos.X = x * 2;
pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}

int main(void)
{
using std::cout;
int x=0;
while(x {
x=x+2;
gotoxy(x,14);
cout }
cout system("pause");
return 0;
}
#include
#include
#include
#include
void gotoxy(int x, int y)//定位光标
{
COORD pos;
pos.X = x * 2;
pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}

int main(void)
{
int x=0;
while(x<20)
{
x=x+2;
gotoxy(x,14);
cout<<"*";
}
cout<<endl;
system("pause");
return 0;
}

  • 写回答

1条回答 默认 最新

  • devmiao 2015-12-25 15:20
    关注

    一个是标准库,一个是带命名空间,所以是不同的

    评论

报告相同问题?

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突