21天养成良好习惯-11
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float x,y;
scanf("%f",&x);
if(x>=0){
y=sqrt(x);
}
else{
y=pow((x+1),2)+2*x+1/x;
}
printf(“f(%.2f) = %.2f”,x,y);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int s1,a,b;
s1=scanf("%d %d",&a,&b);
if(s1==2){
printf(“a = %d, b = %d\n”,a,b);
}
else{
printf(“Input error!”);
}
return 0;
}