找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 999|回复: 9

一个关于dev C++的问题

[复制链接]
发表于 2009-11-2 06:00:46 | 显示全部楼层 |阅读模式 IP:江苏扬州
我昨天刚下载了dev C++ 4.9.9.2, 可是不知道为什么什么都运行不了,是不是软件里面要设置什么啊?
我按照书本里面一些简单的code打也运行不了,那黑色匡出现了一下就没了,我按照论坛里面一些正确的code 打了一片也不行,究竟为什么阿?
我用的是英文版,先按file-->new-->source file-->然后打code-->compile-->run
这样子错了吗?还是有设置什么?

我按照书本的code是这样的:
#include <stdio.h>
#include <math.h>
int main (void)
{
double x1=1, y1=5, x2=4, y2=7, side1, side2, distance;

side1 = x2 - x1;
side2 = y2 - y1;
distance = sqrt(side1*side1 + side2*side2);

printf("the distance between the two points is:""%5.2f \n", distance);

return 0;
}
就是显示不了。。。希望高手解答!!!
发表于 2009-11-2 06:00:50 | 显示全部楼层 IP:江苏扬州
先要建立一个project
回复

使用道具 举报

发表于 2009-11-2 06:00:52 | 显示全部楼层 IP:江苏扬州
先建project--&gt;empty project--&gt; c++ project--&gt;然后new file--&gt;在打,还是不行。。。哭。。。
回复

使用道具 举报

发表于 2009-11-2 06:00:57 | 显示全部楼层 IP:江苏扬州
#include <iostream>
#include <cmath>
using namespace std;
int main (void)
{
double x1=1, y1=5, x2=4, y2=7, side1, side2, distance;

side1 = x2 - x1;
side2 = y2 - y1;
distance = sqrt(side1*side1 + side2*side2);

printf("the distance between the two points is:""%5.2f \n", distance);

return 0;
}
试试!
回复

使用道具 举报

发表于 2009-11-2 06:01:01 | 显示全部楼层 IP:江苏扬州
先谢谢2楼和4楼的帮忙,
可是还是不行。。。==!
回复

使用道具 举报

发表于 2009-11-2 06:01:06 | 显示全部楼层 IP:江苏扬州
加一句:system("pause");

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

int main ()
{
double x1=1, y1=5, x2=4, y2=7, side1, side2, distance;

side1 = x2 - x1;
side2 = y2 - y1;
distance = sqrt(side1*side1 + side2*side2);

printf("the distance between the two points is:""%5.2f \n", distance);

system("pause");


return 0;


}
回复

使用道具 举报

发表于 2009-11-2 06:01:13 | 显示全部楼层 IP:江苏扬州
C语言程序在return前加getch();

++语言程序在return前加cin.get();(如果有输入语句cin的,要再加条cin.get())
回复

使用道具 举报

发表于 2009-11-2 06:01:15 | 显示全部楼层 IP:江苏扬州
DEV的编译器你新建个工程,第2页有个win16示范。

或者自己做个段点
int a;cin>>a;
回复

使用道具 举报

发表于 2009-11-2 06:01:20 | 显示全部楼层 IP:江苏扬州
单个文件不需要建工程

#include <iostream>
#include <cmath>
using namespace std;
int main (void)
{
double x1=1, y1=5, x2=4, y2=7, side1, side2, distance;

side1 = x2 - x1;
side2 = y2 - y1;
distance = sqrt(side1*side1 + side2*side2);

cout<<"the distance between the two points is:"<<distance;
system("pause");
return 0;
}

我编译运行都很好,没有问题
回复

使用道具 举报

发表于 2009-11-2 06:01:29 | 显示全部楼层 IP:江苏扬州
#include <stdio.h>
#include <math.h>
#include <conio.h>
int main (void)
{
double x1=1, y1=5, x2=4, y2=7, side1, side2, distance;

side1 = x2 - x1;
side2 = y2 - y1;
distance = sqrt(side1*side1 + side2*side2);

printf("the distance between the two points is:""%5.2f \n", distance);
getch();
return 0;
}

或者:

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(void)
{
double x1=1, y1=5, x2=4, y2=7, side1, side2, distance;

side1 = x2 - x1;
side2 = y2 - y1;
distance = sqrt(side1*side1 + side2*side2);

printf("the distance between the two points is:""%5.2f \n", distance);
system("pause");
return 0;
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 03:25 , Processed in 0.295883 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表