zz的成长

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

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;

int main(int argc, char *argv[]) {
int x,a,y;
cout<<"输入常量a"<<endl;
cin>>a;

cout<<"输入x"<<endl;
cin>>x;
loop:
cin>>x;
if (x<=0)
{

cout<<"输入x"<<endl;
y=sqrt(a*a+x*x); }
else
y=3*a*a*a*x*x+4*a*x-1;
cout<<"输出y"<<y<<endl;

return 0; 
}

#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;

int main(int argc, char *argv[]) {
    int x,n;
    x=0;
    n=2;
    while(x<1000)
{    n=n*2;
    x=x+n*n;
}
n=n/2;
    cout<<"最大n值"<<n<<endl;

    return 0;
}

猜你喜欢

转载自blog.csdn.net/Pharaoh_yd/article/details/70244045
zz