随便写
菜鸟零零七
这个作者很懒,什么都没留下…
展开
-
输入四个整数 比较他们的大小
#include using namespace std; int main() { cout int a,b,c,d,e,f; cin>>a>>b>>c>>d; if (a>b)e=a; else e=b; if(c>d)f=c; else f=d; if(e>f) e=f; cout return 0; }原创 2013-03-09 17:56:25 · 2040 阅读 · 0 评论 -
输出两个数的正差值
#include using namespace std; int main() { int a,b,c; cout cin>>a>>b; if(a>b)c=a-b; else c=b-a; cout return 0; }原创 2013-03-10 19:25:51 · 687 阅读 · 0 评论 -
输出星号图
#include using namespace std; int main() { int i,j; i=7; while(i>=0) { for(j=1;j cout cout --i; } return 0; }转载 2013-03-10 19:36:52 · 536 阅读 · 0 评论 -
求两点间的距离
#incliude #include using namespace std; int main() { double x1,x2,y1,y2,s; cin>>x1>>x2>>y1>>y2; s=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)); cout return 0; }翻译 2013-03-10 20:01:08 · 802 阅读 · 0 评论 -
关于圆的计算 圆柱的 球的 计算问题
#include #include using namespace std; int main() { double r,h,s,c,v,sa,zv,zs,zzv,zzs,pi=3.1415926; cout"请输入半径r:"; cin>>r; cout"请输入高h:"; cin>>h;翻译 2013-03-19 12:14:15 · 706 阅读 · 0 评论 -
输出1000以内奇数的和
#include using namespace std; int main() { int sum=1,i; for(i=2,i { sum=sum+i; } cout return 0; }原创 2013-03-19 21:45:07 · 2415 阅读 · 0 评论