谁帮我把这程序在VS里调试下
来源:百度知道 编辑:UC知道 时间:2024/07/14 01:48:35
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
const int N=50;
int w[N], h[N], t[N];
int len, i, j;
float count=0;
cin>>len;
for(i=0; i<len; i++)
cin>>w[i]>>h[i];
w[i+1]=0;
h[i+1]=h[i]+h[i-1];
t[0]=w[0];
t[1]=(w[0]+w[1]+w[2])*(h[1]+1-h[0])-(h[1]-h[0])*w[1]-(h[2]-h[0])*w[2];
count=w[0];
for(j=2; j<len; j++)
{
count += w[j-1];
if(j%2)
t[j]=t[j-2]+(h[j]-h[j-2]-1)*count+(h[j]-h[j+1])*w[j+1]+count+w[j]+w[j+1];
else
t[j]=t[j-1]-count-(h[j-1]-h[j])*w[j];
}
for(i=0; i<len; i++)
cout<<t[i]<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
在dev-c上运行出来了 vs
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
const int N=50;
int w[N], h[N], t[N];
int len, i, j;
float count=0;
cin>>len;
for(i=0; i<len; i++)
cin>>w[i]>>h[i];
w[i+1]=0;
h[i+1]=h[i]+h[i-1];
t[0]=w[0];
t[1]=(w[0]+w[1]+w[2])*(h[1]+1-h[0])-(h[1]-h[0])*w[1]-(h[2]-h[0])*w[2];
count=w[0];
for(j=2; j<len; j++)
{
count += w[j-1];
if(j%2)
t[j]=t[j-2]+(h[j]-h[j-2]-1)*count+(h[j]-h[j+1])*w[j+1]+count+w[j]+w[j+1];
else
t[j]=t[j-1]-count-(h[j-1]-h[j])*w[j];
}
for(i=0; i<len; i++)
cout<<t[i]<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
在dev-c上运行出来了 vs
这样贴一堆空洞的代码在这里,你又不是Linus Torvalds,除了那些对积分极度饥渴的BT,没有人愿意通过阅读这些玩具代码来理解你的逻辑。这只有靠你用文字叙述,最起码你要说明整个程序的意图和一些实现步骤的大概描述。
谁帮我调试下javabean程序!!!!!!!!!!!!!!!!!!!!!
请帮我调试这个程序
请帮我编写一个C程序,能将角度和弧度互换,需要在turbo c2.0下调试通过
如何把VS.NET2003下的能运行程序改在VC++6.0下运行
为什么XP下用IIS5调试动网的BBS一登陆就出错呢,绝对不是程序的问题,谁帮我分析下啊
为什么XP下用IIS5调试动网的BBS一登陆就出错呢,绝对不是程序的问题,谁帮我分析下啊错误代码:
谁能教我怎么样VB。NET 2003调试我在网上下的.net程序
VB上只能调试,谁能教我把调试好的程序变成真正的程序
求一个在VC。net2003下的串口调试程序
在windows 2003环境下无法调试asp的程序