十年網(wǎng)站開發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營(yíng)維護(hù)+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
static void Main(string[] args)
我們提供的服務(wù)有:成都網(wǎng)站建設(shè)、成都網(wǎng)站制作、微信公眾號(hào)開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、江干ssl等。為數(shù)千家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的江干網(wǎng)站制作公司
{
while (true)
{
Console.Write("請(qǐng)輸入x的值:\nx=");
double x = double.Parse(Console.ReadLine());
double y;
const double e = 2.71828;
if (x 0)
{
y = Math.Log(e, 2);
}
else if (x == 0)
{
y = 1;
}
else
{
y = 1 + Math.Exp(x);
}
Console.WriteLine("y="+y);
}
}
void?main()
{
int?x,y=0;
printf("請(qǐng)輸入一個(gè)整數(shù)\n");
scanf("%d",?x);
printf("x=%d\n",?x);
if(x0){
y?=1;
}else?if(x0){
y=-1;
}else?if(x=0){
y=0;
}else?{
printf("您的輸入有誤");
}
printf("y=%d\n",?y);
}
//?希望可以幫到你望采納~
#include?stdio.h
int?main()
{
int?x,y;
scanf("%d",x);
if(x9)
y=-1;
else?if(3x??x=9)
y=x*(x+2);
else?if(-1x??x=3)
y=2*x;
else?if(x=-1)
y=x-1;
printf("%d\n",y);
while(1);
return?0;
}
不能連續(xù)比較
1. 代碼如下,3)需要實(shí)際運(yùn)行時(shí)輸入測(cè)試
int main(void)
{
double x, y, f;
printf("Please input 2 double number in the form of x y:\n");
scanf("%lf%lf", x, y);
if(x=0 y0)
f = 2*x*x + 3*x +1/(x+y);
else if(x=0 y=0)
f = 2*x*x + 3*x +1/(1+y*y);
else
f = 3*sin(x+y)/(2*x*x) + 3*x + 1;
printf("x=%lf, y=%lf, f(x, y)=%lf\n", x, y, f);
return 0;
}
2.代碼如下
#include stdio.h
#includemath.h
int main(void)
{
double x, y, f;
printf("Please input 2 double number in the form of x y:\n");
scanf("%lf%lf", x, y);
if(x=0)
{
if(y0)
f = 2*x*x + 3*x +1/(x+y);
else
f = 2*x*x + 3*x +1/(1+y*y);
}
else
f = 3*sin(x+y)/(2*x*x) + 3*x + 1;
printf("x=%lf, y=%lf, f(x, y)=%lf\n", x, y, f);
return 0;
}
3.代碼如下
#include stdio.h
int main(void)
{
int score = 0;
printf("Please input a score between 0-100:\n");
scanf("%d", score);
if(score0 || score100)
printf("Wrong input of score!\n");
else if(score=90 score=100)
printf("A\n");
else if(score=80 score=89)
printf("B\n");
else if(score=70 score=79)
printf("C\n");
else if(score=60 score=69)
printf("D\n");
else
printf("E\n");
return 0;
}