#include<stdio.h> int main(void) {char ch1,ch2; i

2024-11-06 11:37:40
推荐回答(2个)
回答1:

输入12
ch1得到1
ch2得到2
n1=ch1-'0'=1
同理,n2=10*1+2=12

回答2:

我的报错和你的不一样。
我改了几个地方:
float->double
scanf里面的%f->%lf
你的weight后面的都写成了wight
#includeint main(void){ double weight; double value; printf("Are you worth your wight in rhodium?\n"); printf("Let's check it out.\n"); printf("Please enter your wight in pounds: "); scanf("%lf",&weight); value = 770 * weight * 14.5833; printf("Your wight in rhodium is worth $%.2f.\n",value); printf("You are easily worth that! If rhodium prices drop.\n"); printf("Eat more to maintain your value.\n"); return 0;}