共回答了19个问题采纳率:89.5%
下面是正文:
#include
#include
#include
int main(int argc,char *argv[])
{
char danwei[3]={'K','M','G'};
int i=-1; bool flag=false;
int x,y,z,p;
double pp;
//explanation
printf("nThis program is to calculate the roots of a quadratic equation.n");
printf("1=宗 2=红 3=澄 4=黄 5=绿 6=蓝 7=紫 8=灰 9=白 0=黑n");
//prompt for input
printf("Please choose the first colours you want:n");
scanf(" %d",&x);
printf("Please choose the second colours you want:n");
scanf(" %d",&y);
printf("Please choose the third colours you want:n");
scanf(" %d",&z);
//calculation
if(x9) { printf("input x error!"); return -1; }
if(y9) { printf("input y error!"); return -1; }
if(z9) { printf("input z error!"); return -1; }
while(z>=3 && i=1000.0 && i
1年前
4