| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1526 人关注过本帖
标题:一个关于dev C++的问题
只看楼主 加入收藏
lehaihua444
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-8-25
收藏
 问题点数:0 回复次数:10 
一个关于dev C++的问题

我昨天刚下载了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;
}
就是显示不了。。。希望高手解答!!!

搜索更多相关主题的帖子: dev code include 书本 
2007-08-25 14:07
远去的列车
Rank: 1
等 级:新手上路
威 望:2
帖 子:205
专家分:0
注 册:2007-8-7
收藏
得分:0 
先要建立一个project

C++学习
2007-08-25 14:09
lehaihua444
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-8-25
收藏
得分:0 
先建project--&gt;empty project--&gt; c++ project--&gt;然后new file--&gt;在打,还是不行。。。哭。。。
2007-08-25 14:12
yuyunliuhen
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:1435
专家分:0
注 册:2005-12-12
收藏
得分:0 

#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;
}
试试!


Go confidently in the  directions of your dreams,live the life you have imagined!Just do it!
It is no use learning without thinking!
2007-08-25 14:16
lehaihua444
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-8-25
收藏
得分:0 
先谢谢2楼和4楼的帮忙,
可是还是不行。。。==!
2007-08-25 14:29
青格儿
Rank: 4
等 级:贵宾
威 望:11
帖 子:698
专家分:20
注 册:2007-7-31
收藏
得分:0 
加一句: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;


}
2007-09-05 14:22
福尔摩斯
Rank: 5Rank: 5
等 级:贵宾
威 望:12
帖 子:4011
专家分:370
注 册:2006-8-15
收藏
得分:0 
C语言程序在return前加getch();

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

自我放逐。。。
2007-09-05 14:29
天使梦魔
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:37
帖 子:564
专家分:2754
注 册:2007-8-29
收藏
得分:0 
DEV的编译器你新建个工程,第2页有个win16示范。

或者自己做个段点
int a;cin>>a;
2007-09-05 16:11
duffebear
Rank: 1
等 级:新手上路
威 望:2
帖 子:172
专家分:0
注 册:2007-1-30
收藏
得分:0 

单个文件不需要建工程

#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;
}

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


死后定当长眠 生前何须久睡
2007-09-06 10:26
PcrazyC
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:5652
专家分:0
注 册:2006-10-20
收藏
得分:0 
#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;
}

雁无留踪之意,水无取影之心
2007-09-06 13:28
快速回复:一个关于dev C++的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012699 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved