c语言色电阻环编程,c 语言的计算(电阻)请问要如何用C计算电阻的三色环如~~宗 黑 红 ==1K#include #include #in...

共回答了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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值